comparison src/goodjava/webserver/RequestParser.java @ 1736:a02a75e3daa8

webserver error handling
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 16 Oct 2022 11:44:23 -0600
parents fa066aaa068c
children 8df0b80e715e
comparison
equal deleted inserted replaced
1735:4b56eff90040 1736:a02a75e3daa8
175 if( parser.match('=') ) { 175 if( parser.match('=') ) {
176 start = parser.currentIndex(); 176 start = parser.currentIndex();
177 while( parser.noneOf(";") ); 177 while( parser.noneOf(";") );
178 String value = parser.textFrom(start); 178 String value = parser.textFrom(start);
179 int len = value.length(); 179 int len = value.length();
180 if( value.charAt(0)=='"' && value.charAt(len-1)=='"' ) 180 if( len > 0 && value.charAt(0)=='"' && value.charAt(len-1)=='"' )
181 value = value.substring(1,len-1); 181 value = value.substring(1,len-1);
182 value = urlDecode(value); 182 value = urlDecode(value);
183 request.cookies.put(name,value); 183 request.cookies.put(name,value);
184 } 184 }
185 if( parser.endOfInput() ) 185 if( parser.endOfInput() )