Browse Source
Prior to this commit, the `HttpHeaders` class would provide constructor variants where the instances are are backed by the existing headers collection given as a parameter. While such constructors are clearly documented and meant for internal usage, there are cases where developers would like to copy the data from an existing headers instance without being backed by the same collection instance and thus, being mutated from some place else. This commit introduces new factory methods `HttpHeaders.copyOf` for this purpose. While this name aligns with some of the Java collections factory methods, in this case the returned instance is not immutable, on purpose. `HttpHeaders` does not extends `MultiValueMap` anymore and shouldn't be seen as such. Closes: gh-34341 Signed-off-by: Bryce J. Fisher <bryce.fisher@gmail.com> [brian.clozel@broadcom.com: reduce scope and update javadoc] Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>pull/34380/head
3 changed files with 36 additions and 2 deletions
Loading…
Reference in new issue