Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal\Core\Routing\RequestFormatRouteFilter can throw Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException, and it does it for html format also, but it shouldn't. So we should add check for format and throw 406 for non html formats only.
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff-2-4.txt | 1.1 KB | aditya.n |
#4 | drupal-core-html-exception-throw-2839622-4-8.2.x-dev.patch | 1.34 KB | aditya.n |
#2 | drupal-format_filter_fix-2839622-2.patch | 1.02 KB | kalistos |
Comments
Comment #2
kalistos CreditAttribution: kalistos at Adyax commentedComment #4
aditya.n CreditAttribution: aditya.n at gai Technologies Pvt Ltd commented@kalistos, since most of your patch fails said 'Failed asserting that 405 is identical to 406' hence just for that I am rolling a patch which will throw a 405 status instead of 406.
P.S I am not sure if it is safe to use other exception handler.
Comment #6
Wim LeersWhy should this not throw a 406 for the HTML format? AFAICT this is entirely correct. Feel free to reopen, but then please at least include a justification/explanation, and even better would be a test showing why it should work differently.