httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derek Basch <dba...@yahoo.com>
Subject [users@httpd] CGI and HTTP Header Location redirects
Date Fri, 04 Feb 2005 00:27:19 GMT
Hello,

I have been dealing with some strange behavior using CGI, python and an HTTP
Header "Location:" redirect on an Apache 1.3 server.

If I call a CGI script and perform a "Location:" redirect the script seems to
silently run off the tracks immediately after the redirect. For example "0.xml"
and "1.xml" are created when there is no redirect and only "0.xml" is created
when a redirect does occur (see below).

Also, after enabling suEXEC on the apache server the script executes perfectly
with the redirect. Can anyone explain this behavior? I would guess that it is
related to apache user rights but I can't find any reference to such problems
via Google.

Thanks everyone!,
Derek Basch

-------------------------------------------------

#! /usr/bin/python

import sys
import cgitb

class Trainer:
		
	def train(self):
		fs = open("/tmp/0.xml", "w")
		fs.close()
##		print "Location: " + "http://www.yahoo.com" + "\n\n"
		sys.stdout.flush()
		fs = open("/tmp/1.xml", "w")
		fs.close()

def main():
	try:
		cgitb.enable()		
		trainer = Trainer()
		trainer.train()

	except Exception, inst:
		cgitb.handler()
	
if __name__ == '__main__':
	main()



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message