Unverified Commit 246a31c4 authored by alexpott's avatar alexpott

Issue #2971012 by Wim Leers, borisson_: ContentTypeHeaderMatcher should not run for DELETE requests

parent aeb5733c
......@@ -15,10 +15,10 @@ class ContentTypeHeaderMatcher implements FilterInterface {
* {@inheritdoc}
*/
public function filter(RouteCollection $collection, Request $request) {
// The Content-type header does not make sense on GET requests, because GET
// requests do not carry any content. Nothing to filter in this case. Same
// for all other safe methods.
if ($request->isMethodSafe(FALSE)) {
// The Content-type header does not make sense on GET or DELETE requests,
// because they do not carry any content. Nothing to filter in this case.
// Same for all other safe methods.
if ($request->isMethodSafe(FALSE) || $request->isMethod('DELETE')) {
return $collection;
}
......
......@@ -61,6 +61,7 @@ public function providerTestSafeRequestFilter() {
['HEAD'],
['OPTIONS'],
['TRACE'],
['DELETE'],
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment