public final class FollowSecureRedirectCallback extends java.lang.Object implements OnRedirectCallback
OnRedirectCallback that follows only secure redirects. A redirect is considered to be secure if origin and target are secure (i.e. if their URL
scheme equals "https"). To get a static instance call getInstance().| Modifier and Type | Method and Description |
|---|---|
boolean |
followRedirect(HttpStatus status,
java.net.URI redirectingLocation,
java.net.URI newLocation)
This is called when a server has sent some sort of redirect.
|
static FollowSecureRedirectCallback |
getInstance()
Returns an instance of
FollowSecureRedirectCallback. |
public static FollowSecureRedirectCallback getInstance()
FollowSecureRedirectCallback.FollowSecureRedirectCallback.public boolean followRedirect(HttpStatus status, java.net.URI redirectingLocation, java.net.URI newLocation)
OnRedirectCallbackRedirectionException is thrown by the HttpRequestExecutor.followRedirect in interface OnRedirectCallbackstatus - One of HttpStatus.MOVED_PERMANENTLY, HttpStatus.FOUND, HttpStatus.SEE_OTHER, HttpStatus.TEMPORARY_REDIRECT or
HttpStatus.PERMANENT_REDIRECT.redirectingLocation - The absolute URI of the resource that returned the redirect.newLocation - The absolute URI that was returned by the server as the new location.true to follow that redirect and resent the request to the new location, false to not follow it and throw a
RedirectionException instead.