indygreg added a comment.

  In https://phab.mercurial-scm.org/D1850#31404, @joerg.sonnenberger wrote:
  
  > Which status code shall we use then, just plain 400?
  
  
  Good question.
  
  We use `400` for parts of hgweb. But not the wire protocol parts. And the use 
of `400` should arguably be avoided because it is supposed to mean the HTTP 
request message itself was malformed. A lot of people (including our uses in 
hgweb) extend `400` to mean things like the query string parameters are 
invalid. RFC 7231 is still vague in its wording and does seem to allow liberal 
use of this status code. That's probably because of common use of `400` in the 
wild.
  
  In the wire protocol today, it looks like we use `200` and a `Content-Type: 
application/hg-error` to indicate error. I think this is what we should use 
here (assuming existing client codes handles the error sanely). It should, 
since `httppeer.py` always checks for this content-type as part of processing 
every HTTP response.
  
  For the next submission, please add a test showing that an `hg` operation 
hitting this error in the context of `hg pull` or `hg clone` does something 
reasonable.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1850

To: joerg.sonnenberger, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to