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

#1490 Add support for X-Forwarded-Port header. #1491

Merged
merged 3 commits into from
May 18, 2016

Conversation

mintyfresh
Copy link
Contributor

Honours the X-Forwarded-Port header, when present.

url.schema = "https";
if (m_port != 443) url.port = m_port;
// Set URL port segment.
Nullable!ushort port;
Copy link
Member

Choose a reason for hiding this comment

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

Could simply use ushort port = 0; here, because 0 isn't a valid port anyway.

@s-ludwig
Copy link
Member

Okay, thanks! Merging in.

if (m_port != 80) url.port = m_port;
// Set URL schema segment.
if (auto xfp = this.headers.get("X-Forwarded-Proto")) {
url.schema = xfp;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd argue this should set the port to the default port for that schema for cases where X-Forwarded-Port isn't set.

Copy link
Member

Choose a reason for hiding this comment

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

Setting no port (defaut of 0) is considered to be implicitly equal to setting the default port. Are you thinking of something in particular that is broken?

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.

3 participants