diff 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
line wrap: on
line diff
--- a/src/goodjava/webserver/RequestParser.java	Sun Oct 02 17:32:00 2022 -0600
+++ b/src/goodjava/webserver/RequestParser.java	Sun Oct 16 11:44:23 2022 -0600
@@ -177,7 +177,7 @@
 				while( parser.noneOf(";") );
 				String value = parser.textFrom(start);
 				int len = value.length();
-				if( value.charAt(0)=='"' && value.charAt(len-1)=='"' )
+				if( len > 0 && value.charAt(0)=='"' && value.charAt(len-1)=='"' )
 					value = value.substring(1,len-1);
 				value = urlDecode(value);
 				request.cookies.put(name,value);