Bug #38662

Media type not supported should throw 415 rather than 406

Added by Adrian Föder about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
MVC
Start date:
2012-07-05
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

In the AbstractController there's a check for supported media types. If this does not match, currently a 406 is thrown but should be 415.

#1

Updated by Gerrit Code Review about 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12620

#2

Updated by Adrian Föder about 9 years ago

  • Subject changed from Nedia type not supported should throw 415 rather than 406 to Media type not supported should throw 415 rather than 406
#3

Updated by Karsten Dambekalns about 9 years ago

While this may be more intuitive, it is wrong. From http://stackoverflow.com/questions/3294483/http-406-and-415-error-codes comes this nice explanation:

  • 406 is returned by the server when it can't respond based on accepting the request headers (ie they have an Accept header which states they only want XML).
  • 415 is returned by the server when the entity sent in a request (content in a POST or PUT) has an unsupported mediatype (i.e. they sent XML).

so.. 406 when you can't send what they want, 415 when they send what you don't want.

#4

Updated by Karsten Dambekalns about 9 years ago

  • Status changed from Under Review to Closed

Also available in: Atom PDF