As discussed in #35762, HttpEntity currently makes HttpHeaders read-only as part of its constructors. This means that once instantiated, a ResponseEntity cannot mutate its headers anymore.

While immutability is an interesting design principle, here we shouldn't enforce headers as read-only.