Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safety fixes in interpretation of X-Forwarded-Host #6

Conversation

tareksha
Copy link
Contributor

@tareksha tareksha commented Jun 5, 2015

1- Follow IETF standard in host syntax
2- Correctly detect default HTTP/HTTPs port in the URI

Signed-off-by: Tareq Sharafy tareq.sharafy@sap.com

1- Follow IETF standard in host syntax
2- Correctly detect default HTTP/HTTPs port in the URI

Signed-off-by: Tareq Sharafy <tareq.sharafy@sap.com>
@@ -44,15 +47,31 @@ public static ServletContainerRequest create(final HttpServletRequest req) {
if (port < 0) {
port = forwardedUrl.getDefaultPort();
}
if (LOG.isInfoEnabled()) {
LOG.info("Assuming forwarded URL: " + forwardedUrl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can replace this block with

LOG.debug("Assuming forwarded URL: {}" , forwardedUrl);

skabashnyuk added a commit that referenced this pull request Jun 5, 2015
Safety fixes in interpretation of X-Forwarded-Host
@skabashnyuk skabashnyuk merged commit 572ef73 into codenvy:forwarding_headers_andrew00x Jun 5, 2015
@tareksha tareksha deleted the forwarding_header_safety branch June 27, 2015 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants