Mercurial > public > mercurial-scm > hg-stable
diff tests/test-hgweb-commands.t @ 18521:0af2fe7b3274 stable
hgweb: returns 404 for unknow revision instead of 500
I noticed that access to filtered revision returned HTTP 500 code (internal
server error). Investigation shown that it was the case for unknown revision
too. That wrong and we now properly return a 404 for revision not found.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 31 Jan 2013 22:30:52 +0100 |
parents | 0c51532ec233 |
children | e8efcc8ff5c0 |
line wrap: on
line diff
--- a/tests/test-hgweb-commands.t Thu Jan 31 01:44:29 2013 +0100 +++ b/tests/test-hgweb-commands.t Thu Jan 31 22:30:52 2013 +0100 @@ -1392,4 +1392,33 @@ $ grep Status search Status: 200 Script output follows\r (esc) +proper status for filtered revision + + +(missing rev) + + $ PATH_INFO=/rev/5; export PATH_INFO + $ QUERY_STRING='style=raw' + $ python hgweb.cgi #> search + Status: 404 Not Found\r (esc) + ETag: *\r (glob) (esc) + Content-Type: text/plain; charset=ascii\r (esc) + \r (esc) + + error: unknown revision '5' + + + +(filtered rev) + + $ PATH_INFO=/rev/4; export PATH_INFO + $ QUERY_STRING='style=raw' + $ python hgweb.cgi #> search + Status: 404 Not Found\r (esc) + ETag: *\r (glob) (esc) + Content-Type: text/plain; charset=ascii\r (esc) + \r (esc) + + error: unknown revision '4' + $ cd ..