Remove/overwrite header in MockHttpServletRequest [SPR-17288] #21821
Labels
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
Christopher Smith opened SPR-17288 and commented
MockHttpServletRequest
supports adding arbitrary headers, but subsequent calls toaddHeader
always append the new values. While the internaldoAddHeaderValue
takes a boolean to specify replacement, it's not visible externally. When using the class for testing, it is often useful to construct it with the usual headers in asetup
method, but there's no way to then overwrite a header per-test.It would be useful to be able to remove an existing header from the request (either to leave it missing or to then replace it with a new value).
Affects: 4.3.19
Issue Links:
The text was updated successfully, but these errors were encountered: