My reading of RFC 2616 hasn't answered my question:
How should a server interpret multiple Accept, Accept-Encoding, Accept-Language, etc, headers?
Granted, this should generally be a rare occurrence, but far be it from me to assume every HTTP client actually does what it should.
Imagine an HTTP request includes the following:
Accept-Language: en
Accept-Language: pt
Should the server:
- Combine the results, to an effective
Accept-Language: en, pt
? - Honor only the first one (
en
)? - Honor only the last one (
pt
)? - Throw a hissy fit (return a 400 status, perhaps?)
Option #1 seems the most natural to me, and the most likely to be what the client means, and the least likely to completely break expectations even if it's not what the client means.
But is there any actual rule (ideally specified by an RFC) for how to handle these situations?