[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #21036 [Metrics/Onionoo]: Onionoo doesn't return JSON for error responses
#21036: Onionoo doesn't return JSON for error responses
-----------------------------+------------------------------
Reporter: lukechilds | Owner: metrics-team
Type: defect | Status: new
Priority: Low | Milestone:
Component: Metrics/Onionoo | Version:
Severity: Minor | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
-----------------------------+------------------------------
Comment (by karsten):
Interesting. I wonder whether you (or in this case your HTTP library)
should even attempt to parse the body of a 400 response. It seems
potentially problematic with many other web services.
I'm not yet convinced though that we should return JSON responses for
error cases. We'd have to extend the JSON format just for this, which
seems like overkill. In theory, returning an HTTP error code should be
sufficient for clients.
So, I agree that it might be confusing to return an HTML body in these
error cases and a JSON response in the success case. I guess that's a
matter of configuring Jetty to not provide HTML output together with the
HTTP 400 response and instead provide an empty body. Would that be
better? And would browsers (and browser users) be okay with that?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21036#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs