Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在尝试为我的 java 应用程序实施更多安全措施,并且遇到了使用 x-content-type-options no sniff 的建议。经过搜索,我找不到任何方法来实现此功能。任何帮助是极大的赞赏。
假设您使用的是 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>