code: private static URI extractRedirectLocation(HttpMessage message) throws InvalidRedirectLocationException {
          String location = message.getResponseHeader().getHeader(HttpHeader.LOCATION);
          if (location == null) {
              if (log.isDebugEnabled()) {
                  log.debug("No Location header found: " + message.getResponseHeader());
              }
              return null;
          }
  
          try {
              return new URI(message.getRequestHeader().getURI(), location, true);
          } catch (URIException ex) {
              throw new InvalidRedirectLocationException("Invalid redirect location: " + location, location, ex);
          }
      }
docs: Extracts a {@code URI} from the {@code Location} header of the given HTTP {@code message}.
  <p>
  If there's no {@code Location} header this method returns {@code null}.
  
  @param message the HTTP message that will processed
  @return the {@code URI} created from the value of the {@code Location} header, might be {@code null}
  @throws InvalidRedirectLocationException if the value of {@code Location} header is not a valid {@code URI}