Patchwork [stable] hgweb.cgi: fix internal WSGI emulation (issue3804)

login
register
mail settings
Submitter Kevin Bullock
Date Feb. 4, 2013, 5:18 p.m.
Message ID <359DAB58-DA03-4DBE-B446-CC14D13721FF@ringworld.org>
Download mbox | patch
Permalink /patch/801/
State Accepted
Commit e8efcc8ff5c0b1b16f2a6f22f4375c0002133aff
Headers show

Comments

Mads Kiilerich - Feb. 4, 2013, 5:51 p.m.
On 02/04/2013 06:18 PM, Kevin Bullock wrote:
> On Feb 4, 2013, at 9:51 AM, Mads Kiilerich wrote:
>
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1359993046 -3600
>> # Branch stable
>> # Node ID 8fff1e69052818a40110eb00589742dd40bd2fde
>> # Parent  12de53323e59ce3e5f31472ee781649669d6ca9c
>> hgweb.cgi: fix internal WSGI emulation (issue3804)
> Looks good, but:

Oops - I just _knew_ that we didn't have test coverage for this - 
otherwise we would have caught it ;-) Will fix.

> --- /home/kbullock/hg/hg/tests/test-hgweb-commands.t
> +++ /home/kbullock/hg/hg/tests/test-hgweb-commands.t.err
> @@ -1377,12 +1377,20 @@
>     $ PATH_INFO=/bookmarks; export PATH_INFO
>     $ QUERY_STRING='style=raw'
>     $ python hgweb.cgi
> +  Status: 200 Script output follows\r (esc)
> +  ETag: 1359997449.25\r (esc)
> +  Content-Type: text/plain; charset=ascii\r (esc)
> +  \r (esc)
>   
>   listbookmarks hides secret bookmarks
>   
>     $ PATH_INFO=/; export PATH_INFO
>     $ QUERY_STRING='cmd=listkeys&namespace=bookmarks'
>     $ python hgweb.cgi
> +  Status: 200 Script output follows\r (esc)
> +  Content-Type: application/mercurial-0.1\r (esc)
> +  Content-Length: 0\r (esc)
> +  \r (esc)
>   
>   search works with filtering
>   
>
> ERROR: /home/kbullock/hg/hg/tests/test-hgweb-commands.t output changed
>
> I had thought, when I added those tests to test-hgweb-commands.t, that it was a bit odd that they weren't returning _anything_, even headers. Guess I was right.

Heh, yeah, I also remember wondering about that a bit ... but added 2 
and 2 and got 0 ;-)

/Mads

Patch

--- /home/kbullock/hg/hg/tests/test-hgweb-commands.t
+++ /home/kbullock/hg/hg/tests/test-hgweb-commands.t.err
@@ -1377,12 +1377,20 @@ 
   $ PATH_INFO=/bookmarks; export PATH_INFO
   $ QUERY_STRING='style=raw'
   $ python hgweb.cgi
+  Status: 200 Script output follows\r (esc)
+  ETag: 1359997449.25\r (esc)
+  Content-Type: text/plain; charset=ascii\r (esc)
+  \r (esc)
 
 listbookmarks hides secret bookmarks
 
   $ PATH_INFO=/; export PATH_INFO
   $ QUERY_STRING='cmd=listkeys&namespace=bookmarks'
   $ python hgweb.cgi
+  Status: 200 Script output follows\r (esc)
+  Content-Type: application/mercurial-0.1\r (esc)
+  Content-Length: 0\r (esc)
+  \r (esc)
 
 search works with filtering