Skip to content

daemon/http: HTTP response codes

Oto Šťáva requested to merge doh2-status-codes into master

Fixes #728 (closed)

Related #618 (closed)

Currently:

  • Replies with 400 when a GET 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 the POST body is malformed (but only if DNS itself cannot deal with it, then it is 200 as per RFC 8484)
  • Reply with 413 when the POST body is too long (attempted but not working at the moment) (changed to 400)
  • Reply with 414 when the GET URL is too long (changed to 400)
  • 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

Merge request reports