mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8368093: Remove Stream::createPseudoHeaders
Reviewed-by: dfuchs, jpai, vyazici
This commit is contained in:
parent
13e062e7a3
commit
5cba2c8461
@ -31,7 +31,6 @@ import java.io.UncheckedIOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.net.ProtocolException;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpResponse.BodyHandler;
|
||||
import java.net.http.HttpResponse.ResponseInfo;
|
||||
import java.nio.ByteBuffer;
|
||||
@ -973,36 +972,6 @@ class Stream<T> extends ExchangeImpl<T> {
|
||||
return headers;
|
||||
}
|
||||
|
||||
private static HttpHeaders createPseudoHeaders(HttpRequest request) {
|
||||
HttpHeadersBuilder hdrs = new HttpHeadersBuilder();
|
||||
String method = request.method();
|
||||
hdrs.setHeader(":method", method);
|
||||
URI uri = request.uri();
|
||||
hdrs.setHeader(":scheme", uri.getScheme());
|
||||
String host = uri.getHost();
|
||||
int port = uri.getPort();
|
||||
assert host != null;
|
||||
if (port != -1) {
|
||||
hdrs.setHeader(":authority", host + ":" + port);
|
||||
} else {
|
||||
hdrs.setHeader(":authority", host);
|
||||
}
|
||||
String query = uri.getRawQuery();
|
||||
String path = uri.getRawPath();
|
||||
if (path == null || path.isEmpty()) {
|
||||
if (method.equalsIgnoreCase("OPTIONS")) {
|
||||
path = "*";
|
||||
} else {
|
||||
path = "/";
|
||||
}
|
||||
}
|
||||
if (query != null) {
|
||||
path += "?" + query;
|
||||
}
|
||||
hdrs.setHeader(":path", Utils.encode(path));
|
||||
return hdrs.build();
|
||||
}
|
||||
|
||||
HttpHeaders getRequestPseudoHeaders() {
|
||||
return requestPseudoHeaders;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user