Closed BlackCrawler closed 4 years ago
Only GET method is implemented for the route "/ping".
RFC 7231 states that:
The server SHOULD send the same header fields in response to a HEAD request as it would have sent if the request had been a GET...
Where SHOULD is:
SHOULD This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.
That is, RFC allows such implementations. I consider "/ping" as part of the API, the use of which is strictly limited to the needs of the application, specifically the GET method.
If someone adds the processing of missing methods to fully comply with RFC recommendations, such changes will of course be accepted.
I figured it was easier to change this on the frontend, no server changes required: https://github.com/airmash-refugees/airmash-frontend/commit/d817fa88afbb893feca8479471f09226881d3e57
(This change is okay because it doesn't matter to the frontend what response it gets or which HTTP verb is used to elicit that response, it just looks at the timing.)
I noticed many 404 errors in nginx logs.
I guess HEAD is not supported by the server, since
curl -I http://localhost:3501/ping
:And
curl http://localhost:3501/ping