Static file's content-type header for directory listing removed after added “X-Content-Type-Options”...












0















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









share|improve this question

























  • - Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]

    – Giri
    Jan 12 at 14:28
















0















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









share|improve this question

























  • - Known issue in EAP 7, refer JIRA for more details : [issues.jboss.org/browse/WFLY-11558]

    – Giri
    Jan 12 at 14:28














0












0








0








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









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • - 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












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
});


}
});














draft saved

draft discarded


















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
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas