Skip to content
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

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

Closed
spring-projects-issues opened this issue Mar 1, 2010 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good point. As of Spring 3.0.2, WebContentInterceptor does not restrict HTTP methods by default anymore - just like AnnotationMethodHandlerAdapter which doesn't restrict those for its general controller model either. WebContentInterceptor should have been aligned with this in 3.0 GA already.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants