Skip to content

Allow HttpHeaders invocation on MockHttpServletRequest and MockHttpServletRequestBuilder #35576

@rwinch

Description

@rwinch

It's nice that WebClient and RestClient provide access to the rich HttpHeaders object for setting things like HTTP Basic.

WebClient.create().get()
	.uri("/")
	.headers(h -> h.setBasicAuth("user", "password"))
        // ...

It would be nice if MockHttpServletRequest and MockHttpServletRequestBuilder exposed a method that allowed users to leverage HttpHeaders in a similar way as illustrated above.

NOTE: setHeaders(HttpHeaders) is not desirable because it requires setting all of the headers vs updating the existing HttpHeaders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: testIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions