在 Tomcat 中禁用 HTTP 方法
我已阅读有关禁用 Tomcat 中的方法列表的这些问题:
但是有没有办法返回 405 响应而不是 403 响应?
I have read these questions on disabling a list of methods in Tomcat:
- How can I disable HTTP Methods for Tomcat 5.5.27
- Disabling PUT TRACE DELETE request in Apache Tomcat 6.0
But is there a way to return a 405 response instead of a 403 response?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
构建一个 servlet 过滤器来检查请求方法,如果该方法位于黑名单上,则发送 405 响应。
Build a servlet filter that checks the request method and sends a 405 response if the method is on a blacklist.