WebOutput minor updates
Rename "headers" to "responseHeaders" and clarify those work for HTTP request queries but not for queries over a WebSocket session. Update getter for response headers to return a read-only wrapper. Provide only one public constructor without headers. See gh-42
This commit is contained in:
@@ -141,8 +141,8 @@ class WebFluxApplicationContextTests {
|
||||
public WebInterceptor customWebInterceptor() {
|
||||
return new WebInterceptor() {
|
||||
@Override
|
||||
public Mono<WebOutput> postHandle(WebOutput webOutput) {
|
||||
return Mono.just(webOutput.transform(output -> output.header("X-Custom-Header", "42")));
|
||||
public Mono<WebOutput> postHandle(WebOutput output) {
|
||||
return Mono.just(output.transform(builder -> builder.responseHeader("X-Custom-Header", "42")));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -137,8 +137,9 @@ class WebMvcApplicationContextTests {
|
||||
public WebInterceptor customWebInterceptor() {
|
||||
return new WebInterceptor() {
|
||||
@Override
|
||||
public Mono<WebOutput> postHandle(WebOutput webOutput) {
|
||||
return Mono.just(webOutput.transform(output -> output.header("X-Custom-Header", "42")));
|
||||
public Mono<WebOutput> postHandle(WebOutput output) {
|
||||
return Mono.just(output.transform(builder ->
|
||||
builder.responseHeader("X-Custom-Header", "42")));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user