-
Notifications
You must be signed in to change notification settings - Fork 974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UNDERTOW-852] Web server should return 501 for unknown METHOD requests #432
Conversation
Windows Build 1802 outcome was FAILURE using a merge of 3b9d00f Failed tests
|
@@ -59,6 +60,9 @@ | |||
*/ | |||
public class ResourceHandler implements HttpHandler { | |||
|
|||
private static final List<HttpString> KNOWN_METHODS = Arrays.asList(Methods.OPTIONS, Methods.GET, Methods.HEAD, | |||
Methods.POST, Methods.PUT, Methods.DELETE, Methods.TRACE); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this me part of Methods
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could probably move it to Methods and call it HTTP11_PRESCRIBED or some such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a set rather than a list, although I don't think it is really necessary to move it
Retest this please. |
Windows Build 1803 outcome was FAILURE using a merge of 3b9d00f Failed tests
|
3b9d00f
to
83e9e6f
Compare
if (KNOWN_METHODS.contains(exchange.getRequestMethod())) { | ||
exchange.setStatusCode(StatusCodes.METHOD_NOT_ALLOWED); | ||
exchange.getResponseHeaders().add(Headers.ALLOW, | ||
String.join(", ", Methods.GET_STRING, Methods.HEAD_STRING, Methods.POST_STRING)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added Allow header to solve https://issues.jboss.org/browse/JBEAP-6257
Windows Build 1808 outcome was FAILURE using a merge of 83e9e6f Failed tests
|
Windows Build 1810 outcome was FAILURE using a merge of 83e9e6f Failed tests
|
https://issues.jboss.org/browse/UNDERTOW-852
https://issues.jboss.org/browse/JBEAP-6258
https://issues.jboss.org/browse/UNDERTOW-851
https://issues.jboss.org/browse/JBEAP-6257