code: @Override
      public URI getLocationURI(HttpRequest request, HttpResponse response, HttpContext context) throws ProtocolException {
          URI uri = this.redirectStrategy.getLocationURI(request, response, context);
  
          String resultingPageUrl = uri.toString();
  
          DriverRequest driverRequest = ((OutgoingRequest) request).getOriginalRequest();
  
          // Remove context if present
          if (StringUtils.startsWith(resultingPageUrl, driverRequest.getVisibleBaseUrl())) {
              resultingPageUrl =
                      "/"
                              + StringUtils.stripStart(
                                      StringUtils.replace(resultingPageUrl, driverRequest.getVisibleBaseUrl(), ""), "/");
          }
          resultingPageUrl = ResourceUtils.getHttpUrlWithQueryString(resultingPageUrl, driverRequest, false);
  
          return UriUtils.createURI(ResourceUtils.getHttpUrlWithQueryString(resultingPageUrl, driverRequest, false));
      }
docs: For local redirects, converts to relative urls.
  
  @param request
  must be an {@link OutgoingRequest}.