Package org.swisspush.gateleen.core.util
Class HttpServerRequestUtil
- java.lang.Object
-
- org.swisspush.gateleen.core.util.HttpServerRequestUtil
-
public class HttpServerRequestUtil extends Object
Class HttpServerRequestUtil.- Author:
- https://github.com/mcweba [Marc-Andre Weber]
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidincreaseRequestHops(io.vertx.core.http.HttpServerRequest request)Increases the value of theHttpRequestHeader.X_HOPSheader.static booleanisRemoteAddressLoopbackAddress(io.vertx.core.http.HttpServerRequest request)static booleanisRequestHopsLimitExceeded(io.vertx.core.http.HttpServerRequest request, Integer hopsLimit)Checks whether the request hops limit is reached based on theHttpRequestHeader.X_HOPSheader.static voidprepareResponse(io.vertx.core.http.HttpServerRequest request, io.vertx.core.http.HttpClientResponse response)Prepares the request's response by copying values from response.
-
-
-
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 theHttpRequestHeader.X_HOPSheader. 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 theHttpRequestHeader.X_HOPSheader.- Parameters:
request- the request to checkhopsLimit- the request hops limit- Returns:
- returns true when the
HttpRequestHeader.X_HOPSheader 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 modifyresponse- the response containing needed values
-
-