Interface RequestFilter


  • public interface RequestFilter
    A functional interface to simplify modification and manipulation of requests.
    • Method Detail

      • filterRequest

        io.netty.handler.codec.http.HttpResponse filterRequest​(io.netty.handler.codec.http.HttpRequest request,
                                                               HttpMessageContents contents,
                                                               HttpMessageInfo messageInfo)
        Implement this method to filter an HTTP request. The HTTP method, URI, headers, etc. are available in the request parameter, while the contents of the message are available in the contents parameter. The request can be modified directly, while the contents may be modified using the HttpMessageContents.setTextContents(String) or HttpMessageContents.setBinaryContents(byte[]) methods. The request can be "short-circuited" by returning a non-null value.
        Parameters:
        request - The request object, including method, URI, headers, etc. Modifications to the request object will be reflected in the request sent to the server.
        contents - The request contents.
        messageInfo - Additional information relating to the HTTP message.
        Returns:
        if the return value is non-null, the proxy will suppress the request and send the specified response to the client immediately