TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Disagreements with HTTP Spec 501 Not Implemented

2 点作者 wristmittens超过 5 年前
I have some disagreements with how the HTTP specification for 501 Not Implemented is defined &amp; used, and not sure where to think out loud about this.<p>&gt; 6.6.2. 501 Not Implemented &gt; The 501 (Not Implemented) status code indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.<p>However, metrics &amp; monitors have generally evolved to measure a basic website &quot;uptime&quot; as a percentage of requests: (non-5xx) &#x2F; (non-5xx + 5xx). A surge in 5xx response codes is a &quot;something is wrong, we need to act now&quot; PagerDuty type event.<p>So given the above, it&#x27;s easy for a crawler &#x2F; bot &#x2F; malicious user to just `curl myserver.example.com -X FLUBBER` and generate a flurry of 501 Not Implemented (for Akka in this case) and erroneously trigger uptime monitors. (This happened to us, hence this inquiry.)<p>Instead, I feel that an unknown HTTP request should return 405 Method Not Allowed for any unknown request types, since it&#x27;s a bad request, not a server error.<p>Do you have any thoughts?<p>[edit] It looks like Google is returning 405:<p>% curl https:&#x2F;&#x2F;www.google.com&#x2F; --silent --include -X FLUBBER | grep HTTP<p>HTTP&#x2F;2 405

暂无评论

暂无评论