jakartaee / servlet

Jakarta Servlet
https://eclipse.org/ee4j/servlet
Other
266 stars 87 forks source link

Fix issue #325 - Clarify get[Int|Date]Header() for multiple headers #477

Closed markt-asf closed 1 year ago

markt-asf commented 1 year ago

Fixes #325

This one is not clear-cut. There are a couple of different options for how we could handle this.

This PR implements the more backwards compatible approach which is to align with getHeader() and state that if there are multiple headers with the same name, only the first is used.

Alternatives include:

Given the potential for breakage if an exception is thrown, I think alignment with getHeader() is the way to go.