[PATCH] Defined REQUEST_URI on Microsoft IIS servers

Ezra.Smith at bentley.com Ezra.Smith at bentley.com
Wed Oct 31 15:13:02 UTC 2007


Apologies for the spam. Outlook seems quite adamant about formatting my

emails after I've hit the send button. This one really should be clean,
though.

 

-Ezra

=========================================

 

# HG changeset patch

# User Ezra Smith <ezra.smith at bentley.com>

# Date 1193841248 14400

# Node ID ab23db2972325313ac86588b834eb9e630ec44b3

# Parent  3aa5c45874c60560d75df74adbc964e107c8538a

Defined the REQUEST_URI environment variable on Microsoft IIS

web servers, which do not have it defined by default.

 

diff -r 3aa5c45874c6 -r ab23db297232 mercurial/hgweb/hgwebdir_mod.py

--- a/mercurial/hgweb/hgwebdir_mod.py     Sat Oct 20 03:04:34 2007 +0200

+++ b/mercurial/hgweb/hgwebdir_mod.py     Wed Oct 31 10:34:08 2007 -0400

@@ -87,6 +87,11 @@ class hgwebdir(object):

 

         def config(section, name, default=None, untrusted=True):

             return parentui.config(section, name, default, untrusted)

+

+        if (req.env['SERVER_SOFTWARE'].split('/')[0] ==
'Microsoft-IIS'):

+            iis_scriptname = req.env['SCRIPT_NAME']

+            iis_pathinfo = req.env['PATH_INFO']

+            req.env['REQUEST_URI'] = req.env['PATH_INFO'] =
iis_pathinfo[len(iis_scriptname):]

 

         url = req.env['REQUEST_URI'].split('?')[0]

         if not url.endswith('/'):

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20071031/94533c21/attachment.html>


More information about the Mercurial-devel mailing list