Class HostHeaderCustomizer

java.lang.Object
org.eclipse.jetty.server.HostHeaderCustomizer
All Implemented Interfaces:
HttpConfiguration.Customizer

public class HostHeaderCustomizer extends Object implements HttpConfiguration.Customizer
Adds a missing Host header (for example, HTTP 1.0 or 2.0 requests).

The host and port may be provided in the constructor or taken from the Request.getServerName() and Request.getServerPort() methods.

  • Constructor Details

    • HostHeaderCustomizer

      public HostHeaderCustomizer()
      Construct customizer that uses Request.getServerName() and Request.getServerPort() to create a host header.
    • HostHeaderCustomizer

      public HostHeaderCustomizer(String serverName)
      Parameters:
      serverName - the serverName to set on the request (the serverPort will not be set)
    • HostHeaderCustomizer

      public HostHeaderCustomizer(String serverName, int serverPort)
      Parameters:
      serverName - the serverName to set on the request
      serverPort - the serverPort to set on the request
  • Method Details