Skip to content

WebContentInterceptor restricting HTTP request methods by default [SPR-6919] #11584

@spring-projects-issues

Description

@spring-projects-issues

Jamie Goodfellow opened SPR-6919 and commented

The WebContentInterceptor (org.springframework.web.servlet.mvc.WebContentInterceptor) uses the default super-constructor of WebContentGenerator, which configures the interceptor to only support GET, POST, and HEAD requests. This becomes a problem when attempting to use RESTful URLs.

This interceptor should not be concerned with the request type, and should by default be configured to let all request types through. Workaround is to explicitly set the supportedMethods to null (which the WebContentGenerator translates to 'any').

Sample workaround configuration in my mvc:interceptors list:
<bean class="org.springframework.web.servlet.mvc.WebContentInterceptor">
<property name="cacheSeconds" value="0" />
<property name="supportedMethods"><null /></property>
</bean>


Affects: 3.0.1

Referenced from: commits eb1c039

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions