Class HttpServerRequestUtil


  • public class HttpServerRequestUtil
    extends Object
    Class HttpServerRequestUtil.
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Method Detail

      • isRemoteAddressLoopbackAddress

        public static boolean isRemoteAddressLoopbackAddress​(io.vertx.core.http.HttpServerRequest request)
      • increaseRequestHops

        public static void increaseRequestHops​(io.vertx.core.http.HttpServerRequest request)
        Increases the value of the HttpRequestHeader.X_HOPS header. Adds the header when not already present.
        Parameters:
        request - the request to increase the header value
      • isRequestHopsLimitExceeded

        public static boolean isRequestHopsLimitExceeded​(io.vertx.core.http.HttpServerRequest request,
                                                         Integer hopsLimit)
        Checks whether the request hops limit is reached based on the HttpRequestHeader.X_HOPS header.
        Parameters:
        request - the request to check
        hopsLimit - the request hops limit
        Returns:
        returns true when the HttpRequestHeader.X_HOPS header value is greater than the hopsLimit parameter
      • prepareResponse

        public static void prepareResponse​(io.vertx.core.http.HttpServerRequest request,
                                           io.vertx.core.http.HttpClientResponse response)
        Prepares the request's response by copying values from response.
        Parameters:
        request - the request to modify
        response - the response containing needed values