[PATCH] Defined REQUEST_URI on Microsoft IIS servers

Micah Cowan micah at cowan.name
Wed Oct 31 20:00:53 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Ezra.Smith at bentley.com wrote:
> Argh, I didn't think the Gmail one even went through. Again, sorry for
> the excessive spam.

Well, it arrived an hour-and-a-half after you sent it, so I'm not
surprised you didn't know it'd go through. It looks like it spent 30
minutes at gmail, and then spent an hour at waste.org before it was
delivered.

(trimmed trace headers:)
Received: from unknown (HELO waste.org) (66.93.16.53)
  by mx03.nic.name with SMTP; Wed, 31 Oct 2007 16:33:51 -0000
Received: from waste.org (localhost [127.0.0.1])
	by waste.org (8.13.8/8.13.8/Debian-3) with ESMTP id l9VGUi7S017238;
	Wed, 31 Oct 2007 11:31:50 -0500
Received: from nz-out-0506.google.com (nz-out-0506.google.com
[64.233.162.239])
	by waste.org (8.13.8/8.13.8/Debian-3) with ESMTP id l9VFSBcG006034
	for <mercurial-devel at selenic.com>; Wed, 31 Oct 2007 10:28:14 -0500
Received: by nz-out-0506.google.com with SMTP id z31so136344nzd
	for <mercurial-devel at selenic.com>; Wed, 31 Oct 2007 08:28:08 -0700 (PDT)
Received: by 10.114.167.2 with SMTP id p2mr591562wae.1193842824478;
	Wed, 31 Oct 2007 08:00:24 -0700 (PDT)
Received: by 10.115.72.16 with HTTP; Wed, 31 Oct 2007 08:00:24 -0700 (PDT)

You sent it about 8am PDT, it "sat around" until z-out-0506.google.com
got it from an internal machine at 8:28 PDT, which promptly delivered it
to waste.org; it then sat at waste.org until 9:31 PDT, at which point it
was finally delivered (at least to me).

- --

<snipped very helpful explanation of PATH_INFO stuff>

Thanks for that, it made everything much clearer.

> I don't have an Apache server handy to test this on, but I believe that
> REQUEST_URI
> does not actually include the "protocol://SERVER_NAME:SERVER_PORT" part
> of a URI.
> I mostly base this on having googled for some dumps of other people's
> environment
> variables, such as:
> 
> http://www.cinahl.com/wcgis/testenv.cgi?cookies=off
> http://urchin.earth.li/~twic/wml/wap-cgi-environment-variables.html
> http://www.onlamp.com/php/2000/12/01/dump-globals.php

You're right: testing on my own Apache server, REQUEST_URI appears to be
SCRIPT_NAME + PATH_INFO: probably, exactly what IIS already has in
PATH_INFO.

For example, I have a CGI named "env" that's just

  #!/bin/sh

  echo Content-Type: text/plain
  echo
  exec /usr/bin/env

A request URI of <server-name>/cgi-bin/env/foo/bar gives:

...
REQUEST_URI=/cgi-bin/env/foo/bar
SCRIPT_NAME=/cgi-bin/env
PATH_INFO=/foo/bar
...

> I suppose a better alternative is to create REQUEST_URI as it should be
> according to
> standards, and then modify the code block above to use SCRIPT_NAME .

Well, unfortunately, REQUEST_URI is not mentioned in any standard I can
find, nor is it found under Apache's documentation of mod_cgi. I'm not
sure where it comes from. I didn't know what it was supposed to be, so I
made some (erroneous) assumptions.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKN707M8hyUobTrERCNTcAJ9jpNkC/zaiskXWDnRKdigsgRzsxgCfXduK
kjLeeopGnjXQU7ypDb3Wkzk=
=yfxg
-----END PGP SIGNATURE-----



More information about the Mercurial-devel mailing list