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

Add headers that provide extra security protection in browsers #12521

Merged
merged 1 commit into from
Jan 19, 2017

Conversation

jwforres
Copy link
Member

No description provided.

@jwforres
Copy link
Member Author

@liggitt @spadgett PTAL

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Some indentation problems (tabs vs spaces maybe?), but changes LGTM

@@ -52,6 +52,15 @@ func GzipHandler(h http.Handler) http.Handler {
})
}

func BrowserSecurityHandler(h http.Handler) http.Handler {
Copy link
Member

Choose a reason for hiding this comment

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

I have a small preference for SecurityHeadersHandler, which makes it more obvious what the handler is adding

@jwforres
Copy link
Member Author

yeah I need to run gofmt, forgot about that

@jwforres
Copy link
Member Author

updated the handler name and ran gofmt, just need to rebuild to double check everything is still working

@jwforres
Copy link
Member Author

ok verified this builds and is working, @liggitt can you take a quick glance and then i think it is good to merge

return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("X-Content-Type-Options", "nosniff")
w.Header().Add("X-XSS-Protection", "1; mode=block")
w.Header().Add("X-Frame-Options", "DENY")
Copy link
Contributor

Choose a reason for hiding this comment

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

Add or Set?

// http://www.iana.org/assignments/media-types/application/font-sfnt
registerIfNeeded(".ttf", "application/font-sfnt")
registerIfNeeded(".otf", "application/font-sfnt")

// Flash
registerIfNeeded(".swf", "application/x-shockwave-flash")
Copy link
Contributor

Choose a reason for hiding this comment

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

leave this just in case an extension was including a swf

@liggitt
Copy link
Contributor

liggitt commented Jan 17, 2017

a couple nits, LGTM

@jwforres
Copy link
Member Author

jwforres commented Jan 17, 2017 via email

@jwforres jwforres force-pushed the sec_headers branch 2 times, most recently from 6124c0a to 08615c7 Compare January 17, 2017 23:00
@jwforres
Copy link
Member Author

updated, but i need to rebuild/retest in the morning

@jwforres
Copy link
Member Author

ok all comments have been addressed [merge]

@jwforres
Copy link
Member Author

fixed the extension unit test that was expecting text/javascript [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 4222a4d

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 4222a4d

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13004/) (Base Commit: 5d6f8b4)

@openshift-bot
Copy link
Contributor

openshift-bot commented Jan 19, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13014/) (Base Commit: ba792d2) (Image: devenv-rhel7_5719)

@openshift-bot openshift-bot merged commit e0218ac into openshift:master Jan 19, 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.

4 participants