You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the Javadoc, HttpHeaders.EMPTY is immutable.
I found that by using the following code, headers could be added to HttpHeaders.EMPTY.
From then on, any further calls will result in a non-empty HttpHeaders.
This caused a bug in my code where I subsequently used HttpHeaders.EMPTY again to create a new writable HttpHeaders object. I then unknowingly introduced headers used in the previous object
Alfred Thomas opened SPR-17633 and commented
According to the Javadoc, HttpHeaders.EMPTY is immutable.
I found that by using the following code, headers could be added to HttpHeaders.EMPTY.
From then on, any further calls will result in a non-empty HttpHeaders.
I have written a simple unit test to explain this issue:
This caused a bug in my code where I subsequently used HttpHeaders.EMPTY again to create a new writable HttpHeaders object. I then unknowingly introduced headers used in the previous object
Affects: 5.1.3
Reference URL: https://stackoverflow.com/questions/53982635/possible-bug-in-spring-httpheaders
Issue Links:
Referenced from: commits 6e3f974
The text was updated successfully, but these errors were encountered: