-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Always set headers #31231
Always set headers #31231
Conversation
If Apache already set the headers, they will not be defined twice
Codecov Report
@@ Coverage Diff @@
## master #31231 +/- ##
=========================================
Coverage 62.57% 62.57%
Complexity 18234 18234
=========================================
Files 1145 1145
Lines 68396 68396
Branches 1234 1234
=========================================
Hits 42799 42799
Misses 25236 25236
Partials 361 361
Continue to review full report at Codecov.
|
In case this gets merged, I will add this to the nginx config / documentation too. |
Related issues: A good explanation: @butonic @DeepDiver1975 @PVince81 |
@benrubson can you clarify which routes / url show this error?
https://github.com/owncloud/core/blob/master/lib/private/legacy/response.php#L259-L264
https://github.com/owncloud/core/blob/master/.htaccess#L18-L24 As you can see php will also only set the headers if the The code goes a long way not to set these headers twice. Which urls are problematic? |
@butonic, error shows in I agree with you, but in addition to be set by OwnCloud itself, such headers could also already be set by the server administrator, in Apache configuration (i.e. in |
Still facing this with 10.0.10. |
@benrubson pls correct me if I am wrong... |
Yes @mmattel, U're totally right 👍 |
Many thanks @DeepDiver1975 👍 |
For completeness, the docs have been updated
|
@benrubson fyi, the backport for stable10 has been filed but will not make it in the upcoming release due to codefreeze. It will be in the release after. |
Backport |
Hi,
Headers may already be defined in Apache configuration.
This then leads to header values being defined twice, thus triggering such error message :
The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.
This PR then adds the
always
keyword toHeader
definitions, which solves the issue.Thank you 👍
Ben