WebContentInterceptor restricting HTTP request methods by default [SPR-6919] #11584
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
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
The text was updated successfully, but these errors were encountered: