Static file's content-type header for directory listing removed after added “X-Content-Type-Options”...
I am using JBoss EAP 7 and I have a requirement to add X-Content-Type-Options=nosniff
header as part of server hardening.
The content-type header for the html, js(/?js) & css(?css) for directory listing were missing after the header added and chrome filter out the files, we are using Undertow directory listing by the way.
Is there any way to set the files content-type header back so that the chrome not going to filter it out?
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="x-powered-by-header"/>
<filter-ref name="x-xss-protection"/>
<filter-ref name="strict-transport-security"/>
<filter-ref name="x-Content-type-options"/>
</host>
</server>
<servlet-container name="default" default-encoding="UTF-8" directory-listing="true">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" directory-listing="true" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
<response-header name="x-xss-protection" header-name="X-XSS-Protection" header-value="1; mode=block"/>
<response-header name="strict-transport-security" header-name="Strict-Transport-Security" header-value="max-age=31536000; includeSubDomains"/>
<response-header name="x-Content-type-options" header-name="X-Content-Type-Options" header-value="nosniff"/>
</filters>
</subsystem>
Response Headers after added X-Content-Type-Options
HTTP/1.1 200 OK
Date: Wed, 02 Jan 2019 05:42:59 GMT
Server: Apache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Length: 7109
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
jboss jboss-eap-7
add a comment |
I am using JBoss EAP 7 and I have a requirement to add X-Content-Type-Options=nosniff
header as part of server hardening.
The content-type header for the html, js(/?js) & css(?css) for directory listing were missing after the header added and chrome filter out the files, we are using Undertow directory listing by the way.
Is there any way to set the files content-type header back so that the chrome not going to filter it out?
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="x-powered-by-header"/>
<filter-ref name="x-xss-protection"/>
<filter-ref name="strict-transport-security"/>
<filter-ref name="x-Content-type-options"/>
</host>
</server>
<servlet-container name="default" default-encoding="UTF-8" directory-listing="true">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" directory-listing="true" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
<response-header name="x-xss-protection" header-name="X-XSS-Protection" header-value="1; mode=block"/>
<response-header name="strict-transport-security" header-name="Strict-Transport-Security" header-value="max-age=31536000; includeSubDomains"/>
<response-header name="x-Content-type-options" header-name="X-Content-Type-Options" header-value="nosniff"/>
</filters>
</subsystem>
Response Headers after added X-Content-Type-Options
HTTP/1.1 200 OK
Date: Wed, 02 Jan 2019 05:42:59 GMT
Server: Apache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Length: 7109
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
jboss jboss-eap-7
- Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]
– Giri
Jan 12 at 14:28
add a comment |
I am using JBoss EAP 7 and I have a requirement to add X-Content-Type-Options=nosniff
header as part of server hardening.
The content-type header for the html, js(/?js) & css(?css) for directory listing were missing after the header added and chrome filter out the files, we are using Undertow directory listing by the way.
Is there any way to set the files content-type header back so that the chrome not going to filter it out?
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="x-powered-by-header"/>
<filter-ref name="x-xss-protection"/>
<filter-ref name="strict-transport-security"/>
<filter-ref name="x-Content-type-options"/>
</host>
</server>
<servlet-container name="default" default-encoding="UTF-8" directory-listing="true">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" directory-listing="true" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
<response-header name="x-xss-protection" header-name="X-XSS-Protection" header-value="1; mode=block"/>
<response-header name="strict-transport-security" header-name="Strict-Transport-Security" header-value="max-age=31536000; includeSubDomains"/>
<response-header name="x-Content-type-options" header-name="X-Content-Type-Options" header-value="nosniff"/>
</filters>
</subsystem>
Response Headers after added X-Content-Type-Options
HTTP/1.1 200 OK
Date: Wed, 02 Jan 2019 05:42:59 GMT
Server: Apache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Length: 7109
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
jboss jboss-eap-7
I am using JBoss EAP 7 and I have a requirement to add X-Content-Type-Options=nosniff
header as part of server hardening.
The content-type header for the html, js(/?js) & css(?css) for directory listing were missing after the header added and chrome filter out the files, we are using Undertow directory listing by the way.
Is there any way to set the files content-type header back so that the chrome not going to filter it out?
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="x-powered-by-header"/>
<filter-ref name="x-xss-protection"/>
<filter-ref name="strict-transport-security"/>
<filter-ref name="x-Content-type-options"/>
</host>
</server>
<servlet-container name="default" default-encoding="UTF-8" directory-listing="true">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" directory-listing="true" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
<response-header name="x-xss-protection" header-name="X-XSS-Protection" header-value="1; mode=block"/>
<response-header name="strict-transport-security" header-name="Strict-Transport-Security" header-value="max-age=31536000; includeSubDomains"/>
<response-header name="x-Content-type-options" header-name="X-Content-Type-Options" header-value="nosniff"/>
</filters>
</subsystem>
Response Headers after added X-Content-Type-Options
HTTP/1.1 200 OK
Date: Wed, 02 Jan 2019 05:42:59 GMT
Server: Apache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Length: 7109
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
jboss jboss-eap-7
jboss jboss-eap-7
edited Jan 2 at 6:50
xxzufrixx
asked Jan 2 at 6:36
xxzufrixxxxzufrixx
13
13
- Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]
– Giri
Jan 12 at 14:28
add a comment |
- Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]
– Giri
Jan 12 at 14:28
- Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]
– Giri
Jan 12 at 14:28
- Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]
– Giri
Jan 12 at 14:28
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54002215%2fstatic-files-content-type-header-for-directory-listing-removed-after-added-x-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54002215%2fstatic-files-content-type-header-for-directory-listing-removed-after-added-x-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
- Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]
– Giri
Jan 12 at 14:28