The changes made for spring-projects/spring-framework#29972 mean that the list of values with a read-only HttpHeaders instance is now seen as an unmodifiable list when iterating using forEach. We can workaround this change by using addAll rather than putAll. addAll reuses the values from within the list whereas putAll reuses the list itself which is now unmodifiable.