[mod_python] Sugestion about publisher

Damjan arhiv at freemail.org.mk
Fri Jan 5 21:20:10 EST 2001


On Fri, Jan 05, 2001 at 12:49:31PM -0500, Rich Salz wrote:
> Very very cool.  A couple of (minor) things.
> 
> > +        loc = 'http://' + _req.connection.server.server_hostname
>                   ^^^^^^^^^^
> 		should get it out of the uri, since it might be https

I can't see where from in mod_python to get this ?!?

> > +        loc = loc + ':' + str(_req.connection.server.port)
> > +        loc = loc + _req.uri + '/index_html'
> > +        _req.headers_out['Location'] = loc
> > +        raise apache.SERVER_RETURN, apache.HTTP_MOVED_PERMANENTLY
> 					^^^^^^^^^^^^^^^^^^^^^^^^^^^
> should be moved_temporarily, I'm fairly sure.

Well, my Apache returns MOVED_PERMANENTLY for directories, I tried it with:

	damjan# nc local 80
	GET /manual HTTP/1.0

	HTTP/1.1 301 Moved Permanently
	Date: Fri, 05 Jan 2001 20:15:43 GMT
	Server: Apache-AdvancedExtranetServer/1.3.12
	Location: http://localhost.localdomain/manual/
	Connection: close
	Content-Type: text/html; charset=iso-8859-1
	...


> The whole thing should be controlled by a mod_python auto_index option,
> or perhaps based on the DirectoryIndex apache config option?
 
We can think of that later.

One question, should I use req.hostname or 
req.connection.server.server_hostname? (it may be diferent)


-- 
Damjan Georgievski		|           Дамјан Георгиевски
Skopje, Macedonia		|           Скопје, Македонија



More information about the Mod_python mailing list