How to set response Header of non HTML files such as js files for ex. jquery.js files

739 Views Asked by At

I am able to set HSTS header in each JSP page using below code snippet

<%   response.setHeader("Strict-Transport-Security" ,"max-age=7776000" );%>

but Unable to set HSTS header for one of my js files in my code which was reported by Security scan team.

1

There are 1 best solutions below

0
On

Set it at the webserver level and not as part of the JSP. That way it will be set for all resources.