mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Remove individual detection of forwarded headers
This commit removes all places where forwarded headers are checked implicitly, on an ad-hoc basis. ForwardedHeaderFilter is expected to be used instead providing centralized control over using or discarding such headers. Issue: SPR-16668
This commit is contained in:
+1
-20
@@ -38,7 +38,6 @@ import org.springframework.http.HttpCookie;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpRange;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.codec.HttpMessageReader;
|
||||
import org.springframework.http.codec.multipart.Part;
|
||||
@@ -141,7 +140,7 @@ public class MockServerRequest implements ServerRequest {
|
||||
|
||||
@Override
|
||||
public UriBuilder uriBuilder() {
|
||||
return UriComponentsBuilder.fromHttpRequest(new ServerRequestAdapter());
|
||||
return UriComponentsBuilder.fromUri(this.uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -571,22 +570,4 @@ public class MockServerRequest implements ServerRequest {
|
||||
|
||||
}
|
||||
|
||||
private final class ServerRequestAdapter implements HttpRequest {
|
||||
|
||||
@Override
|
||||
public String getMethodValue() {
|
||||
return methodName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public URI getURI() {
|
||||
return MockServerRequest.this.uri;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpHeaders getHeaders() {
|
||||
return MockServerRequest.this.headers.headers;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user