Support non-standard HTTP methods in FrameworkServlet

This commit ensures that HTTP methods not supported by HttpServlet, for
instance WebDAV methods, are still supported in FrameworkServlet.

Closes gh-29689
This commit is contained in:
Arjen Poutsma
2022-12-14 12:54:41 +01:00
parent ca68bbc9ff
commit 6fe5652783
2 changed files with 20 additions and 5 deletions

View File

@@ -875,6 +875,14 @@ public class DispatcherServletTests {
assertThat(getServletContext().getAttribute("otherInitialized")).isEqualTo("true");
}
@Test
public void webDavMethod() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "PROPFIND", "/body.do");
MockHttpServletResponse response = new MockHttpServletResponse();
complexDispatcherServlet.service(request, response);
assertThat(response.getContentAsString()).isEqualTo("body");
}
public static class ControllerFromParent implements Controller {