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

Hosts proxy header option #16

Merged
merged 4 commits into from
Mar 27, 2017
Merged

Conversation

kujenga
Copy link
Contributor

@kujenga kujenga commented Mar 22, 2017

This PR adds support for using Host information coming from an upstream proxy to validate that the site is being contacted with an allowed hostname. It is in the spirit of the SSLProxyHeaders option.

Copy link
Owner

@unrolled unrolled left a comment

Choose a reason for hiding this comment

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

Looks great! Just a comment fix and I'll merge it in.

secure.go Outdated
@@ -122,19 +124,28 @@ func (s *Secure) HandlerFuncWithNext(w http.ResponseWriter, r *http.Request, nex

// Process runs the actual checks and returns an error if the middleware chain should stop.
func (s *Secure) Process(w http.ResponseWriter, r *http.Request) error {
// resolve the host for the request, using proxy headers if present
Copy link
Owner

Choose a reason for hiding this comment

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

Capitalize and add a period at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@unrolled unrolled merged commit 824e852 into unrolled:v1 Mar 27, 2017
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.

2 participants