【发布时间】:2013-04-05 10:42:32
【问题描述】:
我目前正在尝试为我的 java 应用程序实施更多安全措施,并且遇到了使用 x-content-type-options no sniff 的建议。经过搜索,我找不到任何方法来实现此功能。非常感谢任何帮助。
【问题讨论】:
标签: java jsp spring-security http-headers security
我目前正在尝试为我的 java 应用程序实施更多安全措施,并且遇到了使用 x-content-type-options no sniff 的建议。经过搜索,我找不到任何方法来实现此功能。非常感谢任何帮助。
【问题讨论】:
标签: java jsp spring-security http-headers security
假设你使用的是Spring,你可以试试——
<mvc:annotation-driven/>
<mvc:interceptors>
<bean id="webContentInterceptor"
class="org.springframework.web.servlet.mvc.WebContentInterceptor">
<property name="X-Content-Type-Options" value="nosniff"/>
</bean>
</mvc:interceptors>
【讨论】:
annotations做到这一点?