Ensure scheme is set when creating proxy url

Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
This commit is contained in:
Andrew DeMaria
2017-05-18 18:40:57 -06:00
parent 5c71e85e74
commit 0eca4f4e19
@@ -84,6 +84,9 @@ public class NetworkService {
String host = proxyHost.getHost();
int port = proxyHost.getPort();
String scheme = request.getHeader(X_FORWARDED_PROTO);
if(StringUtils.isBlank(scheme)) {
throw new RuntimeException("Scheme not provided");
}
return new URI(scheme, null, host, port, urlPathHelper.getContextPath(request), null, null);
}