[albatross-users] SERVER_NAME vs HTTP_HOST?

Dave Cole djc at object-craft.com.au
Sun Aug 17 20:40:01 EST 2003


> Howdy folks, I've just started playing with albatross, and I quite
> like it.

Thanks.

> One problem I've run into is that I do testing via HTTP tunneling
> over ssh - the hostname I surf to isn't the SERVER_NAME which is
> used in request's get_uri().
> 
> The following change seems to correct the problem for me, but I do
> not know if it will have unintended consequences. Any thoughts?
> 
> --- /home/resolve/albatross-1.10/albatross/cgiapp.py    2003-07-12 14:42:51.000000000 +1000
> +++ /usr/lib/python2.2/site-packages/albatross/cgiapp.py        2003-08-15 22:30:55.000000000 +1000
> @@ -64,7 +64,7 @@
>          return self.__fcgi.env.get('PATH_INFO')
>  
>      def get_servername(self):
> -        return os.environ.get('SERVER_NAME')
> +        return os.environ.get('HTTP_HOST')
>  
>      def get_header(self, name):
>          env_name = 'HTTP_' + name.upper().replace('-', '_')

Applied.

- Dave

-- 
http://www.object-craft.com.au




More information about the Albatross-users mailing list