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

Send the appropriate headers as expected by misc-server tests #184

Merged
merged 2 commits into from
Mar 19, 2021
Merged

Conversation

foolip
Copy link
Member

@foolip foolip commented Mar 19, 2021

There does not appear to be a way to configure DigitalOcean Apps to
always sent some headers (other than CORS) so built it into the app
directly.

@foolip foolip requested a review from domenic as a code owner March 19, 2021 08:44
@annevk
Copy link
Member

annevk commented Mar 19, 2021

Could you also add some documentation to misc-server about places to update if we want to add more headers?

@foolip
Copy link
Member Author

foolip commented Mar 19, 2021

I've sent whatwg/misc-server#148 to delete the old configuration. But there is no central place of headers, just individual places for marquee, isindex and now this repo. Do you want me to link them all together?

@annevk
Copy link
Member

annevk commented Mar 19, 2021

At least some pointer from misc-server to here so it's clear it's now a multi-repo situation.

@foolip
Copy link
Member Author

foolip commented Mar 19, 2021

I've rolled that into whatwg/misc-server#148.

There does not appear to be a way to configure DigitalOcean Apps to
always sent some headers (other than CORS) so built it into the app
directly.
// in https://github.com/whatwg/misc-server.
ctx.set("Strict-Transport-Security", "max-age=63072000; includeSubDomains; preload");
ctx.set("X-Content-Type-Options", "nosniff");
ctx.set("X-Frame-Options", "deny");
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to avoid setting this on non-HTML responses, where it has no impact? You could check if (ctx.type.startsWith("text/html"))

Copy link
Member

Choose a reason for hiding this comment

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

It will have impact, no? Otherwise those responses could be framed.

Copy link
Member Author

Choose a reason for hiding this comment

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

For the misc-server configs we send it unconditionally. If it's merely a no-op for some kinds of responses, isn't that fine?

Copy link
Member

Choose a reason for hiding this comment

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

True, I guess I meant, where it's not needed.

Copy link
Member

Choose a reason for hiding this comment

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

Old somewhat-similar discussion seems to have concluded in favor of using headers more often than not: whatwg/misc-server#90

Co-authored-by: Domenic Denicola <[email protected]>
@foolip foolip merged commit 38ee050 into main Mar 19, 2021
@foolip foolip deleted the headers branch March 19, 2021 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants