1

How should a server react to a malformed Accept-Language header that doesn't conform to RFC 9110? Should it return a 400 Bad Request or should it ignore the header?

I would tend to return a 400 error, but since it is just a preference, maybe it should be handled more gracefully. Does it make a difference if the request is for a web page from a browser or to an Open API endpoint? I couldn't find any information.

STerliakov
  • 4,983
  • 3
  • 15
  • 37
M. Koch
  • 525
  • 4
  • 20
  • Here's one relevant discussion, including top-5 Alexa sites behaviour: https://github.com/dropwizard/dropwizard/issues/2097. [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) suggests to ignore unsupported header value or return a 406 response if this is extremely important. I'd ignore such error. – STerliakov May 19 '23 at 12:07
  • Thank you for the links. Then I will ignore the response. You can add it as an answer then I can accept it. – M. Koch May 19 '23 at 13:39

0 Answers0