diff mercurial/hgweb/protocol.py @ 14094:d10c6835497e

http: minor tweaks to long arg handling x-arg -> x-hgarg replace itertools.count(1)
author Matt Mackall <mpm@selenic.com>
date Sun, 01 May 2011 03:51:04 -0500
parents ce99d887585f
children 1ffeeb91c55d
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py	Sun May 01 01:04:37 2011 +0800
+++ b/mercurial/hgweb/protocol.py	Sun May 01 03:51:04 2011 -0500
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import cgi, cStringIO, itertools, zlib, sys, urllib
+import cgi, cStringIO, zlib, sys, urllib
 from mercurial import util, wireproto
 from common import HTTP_OK
 
@@ -32,11 +32,13 @@
     def _args(self):
         args = self.req.form.copy()
         chunks = []
-        for i in itertools.count(1):
-            h = self.req.env.get('HTTP_X_ARG_' + str(i))
+        i = 1
+        while 1:
+            h = self.req.env.get('HTTP_X_HGARG_' + str(i))
             if h is None:
                 break
             chunks += [h]
+            i += 1
         args.update(cgi.parse_qs(''.join(chunks), keep_blank_values=True))
         return args
     def getfile(self, fp):