diff src/goodjava/webserver/Connection.java @ 1801:32e77b071e09

webserver logging
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 12 Mar 2024 09:28:39 -0600
parents 6c01d54edcac
children
line wrap: on
line diff
--- a/src/goodjava/webserver/Connection.java	Fri Mar 08 10:24:00 2024 -0700
+++ b/src/goodjava/webserver/Connection.java	Tue Mar 12 09:28:39 2024 -0600
@@ -69,7 +69,12 @@
 	
 				String lenStr = (String)request.headers.get("content-length");
 				if( lenStr != null ) {
-					int len = Integer.parseInt(lenStr);
+					int len;
+					try {
+						len = Integer.parseInt(lenStr);
+					} catch(NumberFormatException e) {
+						throw new WrappedRuntimeException(e);
+					}
 					byte[] body = new byte[len];
 					size -= endOfHeader;
 					try {