summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Routing
diff options
context:
space:
mode:
authorAlex Pott2018-05-07 16:16:26 (GMT)
committerAlex Pott2018-05-07 16:16:26 (GMT)
commit246a31c42f85b7986cb67b9dba36e579da1fed33 (patch)
tree5a71eba14f8fbf5bc0b9dd88829d192036e59caa /core/lib/Drupal/Core/Routing
parentaeb5733c8a3403fc4b20ac937cc3b2c7d9a8c99a (diff)
Issue #2971012 by Wim Leers, borisson_: ContentTypeHeaderMatcher should not run for DELETE requests
Diffstat (limited to 'core/lib/Drupal/Core/Routing')
-rw-r--r--core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php b/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php
index 719eeb1..7d66b50 100644
--- a/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php
+++ b/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php
@@ -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;
}