Class NettyHttpRedirectController


  • public class NettyHttpRedirectController
    extends Object
    The HTTP Redirect logic implementation for Netty Connector.
    Since:
    2.47
    • Constructor Detail

      • NettyHttpRedirectController

        public NettyHttpRedirectController()
    • Method Detail

      • prepareRedirect

        public boolean prepareRedirect​(ClientRequest request,
                                       ClientResponse response)
        Configure the HTTP request after HTTP Redirect response has been received. By default, the HTTP POST request is transformed into HTTP GET for status 301 & 302. Also, HTTP Headers described by RFC 9110 Section 15.4 are removed from the new HTTP Request.
        Parameters:
        request - The new ClientRequest to be sent to the redirected URI.
        response - The original HTTP redirect ClientResponse received.
        Returns:
        true when the new request should be sent.
      • restrictRequestHeaders

        protected void restrictRequestHeaders​(ClientRequest request,
                                              ClientResponse response)
        RFC 9110 Section 15.4 defines the HTTP headers that should be removed from the redirected request. https://httpwg.org/specs/rfc9110.html#rfc.section.15.4.
        Parameters:
        request - the new request to a new URI location.
        response - the HTTP redirect response.