Remove ConnectionMetadata customization
This commit is contained in:
parent
0211aa2483
commit
1225c66514
|
@ -19,7 +19,6 @@ import org.eclipse.jetty.http.HttpHeader;
|
|||
import org.eclipse.jetty.http.HttpScheme;
|
||||
import org.eclipse.jetty.http.HttpURI;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.util.HostPort;
|
||||
|
||||
/**
|
||||
* Adds a missing {@code Host} header (for example, HTTP 1.0 or 2.0 requests).
|
||||
|
@ -71,17 +70,6 @@ public class HostHeaderCustomizer implements HttpConfiguration.Customizer
|
|||
builder.add(request.getHeaders());
|
||||
HttpFields headers = builder.asImmutable();
|
||||
|
||||
ConnectionMetaData connectionMetadata = new ConnectionMetaData.Wrapper(request.getConnectionMetaData())
|
||||
{
|
||||
private HostPort _serverAuthority = new HostPort(host, port);
|
||||
|
||||
@Override
|
||||
public HostPort getServerAuthority()
|
||||
{
|
||||
return _serverAuthority;
|
||||
}
|
||||
};
|
||||
|
||||
return new Request.Wrapper(request)
|
||||
{
|
||||
@Override
|
||||
|
@ -95,12 +83,6 @@ public class HostHeaderCustomizer implements HttpConfiguration.Customizer
|
|||
{
|
||||
return headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionMetaData getConnectionMetaData()
|
||||
{
|
||||
return connectionMetadata;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.eclipse.jetty.http.HttpHeader;
|
|||
import org.eclipse.jetty.http.HttpTester;
|
||||
import org.eclipse.jetty.http.HttpURI;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.HostPort;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
@ -54,11 +53,6 @@ public class HostHeaderCustomizerTest
|
|||
assertEquals(serverName, httpURI.getHost());
|
||||
assertEquals(serverPort, httpURI.getPort());
|
||||
|
||||
// Test "connectionMetaData.serverAuthority"
|
||||
HostPort serverAuthority = request.getConnectionMetaData().getServerAuthority();
|
||||
assertEquals(serverName, serverAuthority.getHost());
|
||||
assertEquals(serverPort, serverAuthority.getPort());
|
||||
|
||||
// Test Request.getServerName / Request.getServerPort
|
||||
assertEquals(serverName, Request.getServerName(request));
|
||||
assertEquals(serverPort, Request.getServerPort(request));
|
||||
|
@ -123,11 +117,6 @@ public class HostHeaderCustomizerTest
|
|||
assertEquals(serverName, httpURI.getHost());
|
||||
assertEquals(connector.getLocalPort(), httpURI.getPort());
|
||||
|
||||
// Test "connectionMetaData.serverAuthority"
|
||||
HostPort serverAuthority = request.getConnectionMetaData().getServerAuthority();
|
||||
assertEquals(serverName, serverAuthority.getHost());
|
||||
assertEquals(connector.getLocalPort(), serverAuthority.getPort());
|
||||
|
||||
// Test Request.getServerName / Request.getServerPort
|
||||
assertEquals(serverName, Request.getServerName(request));
|
||||
assertEquals(connector.getLocalPort(), Request.getServerPort(request));
|
||||
|
|
Loading…
Reference in New Issue