Skip to content

Commit

Permalink
Exclude CONNECT from allowed HTTP methods
Browse files Browse the repository at this point in the history
Updated initAllowedHttpMethods in WebContentGenerator and
RequestMappingInfoHandlerMapping to explicitly exclude the CONNECT
method.
  • Loading branch information
v-perfilev committed Jan 5, 2025
1 parent 18106b3 commit b224fea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ private static Set<HttpMethod> initAllowedHttpMethods(Set<String> declaredMethod
Set<HttpMethod> result = CollectionUtils.newLinkedHashSet(declaredMethods.size());
if (declaredMethods.isEmpty()) {
for (HttpMethod method : HttpMethod.values()) {
if (method != HttpMethod.TRACE) {
if (method != HttpMethod.TRACE && method != HttpMethod.CONNECT) {
result.add(method);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void initAllowHeader() {
if (this.supportedMethods == null) {
allowedMethods = new ArrayList<>(HttpMethod.values().length - 1);
for (HttpMethod method : HttpMethod.values()) {
if (method != HttpMethod.TRACE) {
if (method != HttpMethod.TRACE && method != HttpMethod.CONNECT) {
allowedMethods.add(method.name());
}
}
Expand Down

0 comments on commit b224fea

Please sign in to comment.