Remove ConnectionMetadata customization

This commit is contained in:
Joakim Erdfelt 2023-04-27 13:25:39 -05:00
parent 0211aa2483
commit 1225c66514
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
2 changed files with 0 additions and 29 deletions

View File

@ -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;
}
};
}
}

View File

@ -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));