RFR: 8276774: Cookie stored in CookieHandler not sent if user headers contain cookie [v2]

Daniel Fuchs dfuchs at openjdk.java.net
Tue Nov 16 13:17:16 UTC 2021


> Hi,
> 
> Please find enclosed a patch that solves an unexpected interaction between server-set cookies and user-set cookies in the `java.net.HttpClient`.
> 
> In JDK 12 we fixed [JDK-8213189](https://bugs.openjdk.java.net/browse/JDK-8213189) to allow user-supplied header to take precedence over (that is, replace) system-headers. 
> At the time the fact that server cookies would be added to the system-supplied headers by the `CookieHandler` (if present), and that a user-supplied cookie would therefore replace them (instead of simply appending to them)  was overlooked.
> 
> This fix proposes to restore the behavior of JDK 11 WRT to cookies - and arrange for user-supplied cookies to be appended to server-supplied cookies.

Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:

  Minor cleanup

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6408/files
  - new: https://git.openjdk.java.net/jdk/pull/6408/files/f7a1b161..d4755aa4

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6408&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6408&range=00-01

  Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6408.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6408/head:pull/6408

PR: https://git.openjdk.java.net/jdk/pull/6408


More information about the net-dev mailing list