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

dnsdist: default set "Connection: close" header for web requests #6711

Merged
merged 2 commits into from Jun 6, 2018

Conversation

chbruyand
Copy link
Member

Short description

Default add the Connection: close header to dnsdist http responses to indicate that the connection will be closed after completion of the response.

Fix #6532

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@@ -194,6 +194,7 @@ static void addSecurityHeaders(YaHTTP::Response& resp, const boost::optional<std
{ "X-Permitted-Cross-Domain-Policies", "none" },
{ "X-XSS-Protection", "1; mode=block" },
{ "Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'" },
{ "Connection", "close" },
Copy link
Member

Choose a reason for hiding this comment

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

The name of the function (addSecurityHeaders) might not be relevant anymore after that change.

@@ -21,6 +21,7 @@ By default, our web server sends some security-related headers::
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'
Connection: close
Copy link
Member

Choose a reason for hiding this comment

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

I don't think Connection: close belongs here, it's not a security-related header at all.

@chbruyand
Copy link
Member Author

Sorry, didn't pay attention to the name of the function. I did move setting the header where it cannot be overriden as we will always close the connection.

@rgacogne rgacogne merged commit 59de6da into PowerDNS:master Jun 6, 2018
@chbruyand chbruyand deleted the dnsdist-connection-close branch December 5, 2018 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dnsdist: webserver should set Connection: close in standard headers
2 participants