File tree Expand file tree Collapse file tree
src/main/java/org/javawebstack/httpserver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,9 +291,12 @@ private HTTPMethod getRequestMethodFromSocket(IHTTPSocket socket) {
291291 if ("websocket" .equalsIgnoreCase (socket .getRequestHeader ("upgrade" )))
292292 return HTTPMethod .WEBSOCKET ;
293293 if (server .isFormMethods () && (socket .getRequestMethod () == HTTPMethod .GET || socket .getRequestMethod () == HTTPMethod .POST ) && getMimeType () == MimeType .X_WWW_FORM_URLENCODED ) {
294- String rawMethodOverride = getBodyPathElement ("_method" ).string ();
295- if (rawMethodOverride != null )
296- return HTTPMethod .valueOf (rawMethodOverride );
294+ AbstractElement e = getBodyPathElement ("_method" );
295+ if (e != null ) {
296+ try {
297+ return HTTPMethod .valueOf (e .string ());
298+ } catch (IllegalArgumentException ignored ) {}
299+ }
297300 }
298301 return socket .getRequestMethod ();
299302 }
You can’t perform that action at this time.
0 commit comments