I found out that there are servers that respond with HTTP 405 to HEAD
requests (or another status code including 404 which is confusing IMO, but that's not important now) even though GET
requests are responded with HTTP 200. HTTP 405 is defined as...
405 Method Not Allowed
The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.
Alright, I looked at the Allow
header and found out that I can use GET
to get the resource (even though I only wanted to find out whether the resource exists). Problem solved.
However, my question is... Why would a server disallow the HEAD
method? What is the advantage? Are there possible security reasons?