/** * Gets the host and port from the specified request. Returns the host and port from the request URI if available, * otherwise retrieves the host and port from the Host header. * * @param httpRequest HTTP request * @return host and port of the request */ public static String getHostAndPortFromRequest(HttpRequest httpRequest) { if (startsWithHttpOrHttps(httpRequest.getUri())) { try { return getHostAndPortFromUri(httpRequest.getUri()); } catch (URISyntaxException e) { // the URI could not be parsed, so return the host and port in the Host header } } return parseHostHeader(httpRequest, true); }
originalHostAndPort = HttpUtil.getHostAndPortFromUri(originalUrl); } catch (URISyntaxException e) { modifiedHostAndPort = HttpUtil.getHostAndPortFromUri(rewrittenUrl); } catch (URISyntaxException e) { log.warn("Unable to determine host and port from rewritten URL. Host header will not be updated.\n\tOriginal URL: {}\n\tRewritten URL: {}",
/** * Gets the host and port from the specified request. Returns the host and port from the request URI if available, * otherwise retrieves the host and port from the Host header. * * @param httpRequest HTTP request * @return host and port of the request */ public static String getHostAndPortFromRequest(HttpRequest httpRequest) { if (startsWithHttpOrHttps(httpRequest.getUri())) { try { return getHostAndPortFromUri(httpRequest.getUri()); } catch (URISyntaxException e) { // the URI could not be parsed, so return the host and port in the Host header } } return parseHostHeader(httpRequest, true); }
/** * Gets the host and port from the specified request. Returns the host and port from the request URI if available, * otherwise retrieves the host and port from the Host header. * * @param httpRequest HTTP request * @return host and port of the request */ public static String getHostAndPortFromRequest(HttpRequest httpRequest) { if (startsWithHttpOrHttps(httpRequest.getUri())) { try { return getHostAndPortFromUri(httpRequest.getUri()); } catch (URISyntaxException e) { // the URI could not be parsed, so return the host and port in the Host header } } return parseHostHeader(httpRequest, true); }
originalHostAndPort = HttpUtil.getHostAndPortFromUri(originalUrl); } catch (URISyntaxException e) { modifiedHostAndPort = HttpUtil.getHostAndPortFromUri(rewrittenUrl); } catch (URISyntaxException e) { log.warn("Unable to determine host and port from rewritten URL. Host header will not be updated.\n\tOriginal URL: {}\n\tRewritten URL: {}",
originalHostAndPort = HttpUtil.getHostAndPortFromUri(originalUrl); } catch (URISyntaxException e) { modifiedHostAndPort = HttpUtil.getHostAndPortFromUri(rewrittenUrl); } catch (URISyntaxException e) { log.warn("Unable to determine host and port from rewritten URL. Host header will not be updated.\n\tOriginal URL: {}\n\tRewritten URL: {}",
originalHostAndPort = HttpUtil.getHostAndPortFromUri(originalUrl); } catch (URISyntaxException e) { modifiedHostAndPort = HttpUtil.getHostAndPortFromUri(rewrittenUrl); } catch (URISyntaxException e) { log.warn("Unable to determine host and port from rewritten URL. Host header will not be updated.\n\tOriginal URL: {}\n\tRewritten URL: {}",