daemon/http: HTTP response codes
Fixes #728 (closed)
Related #618 (closed)
Currently:
- Replies with
400
when aGET
query has no DNS query in it (the basic case in #728 (closed)) - Replies with
404
when querying unknown endpoints (anything other than/doh
or/dns-query
) - Replies with
431
when a header is too large
To do:
-
Reply with 400
when thePOST
body is malformed (but only if DNS itself cannot deal with it, then it is200
as per RFC 8484) -
Reply with(changed to413
when thePOST
body is too long (attempted but not working at the moment)400
) -
Reply with(changed to414
when theGET
URL is too long400
) -
Check RFCs for more codes -
Make sure the way it's currently simply calling http_send_response
on error does not cause any problems -
Possibly more?
Edited by Vladimír Čunát