473,654 Members | 3,071 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CGIHTTPServer always return 200, no redirects (302) possible

Hi,

The CGIHTTPServer returns

self.send_respo nse(200, "Script output follows")

before it starts the cgi process. This means
you cannot set the status header to 302 for
a redirect.

I don't see a easy and portable way to fix this.

CGIHTTPServer.p y:
http://cvs.sourceforge.net/viewcvs.p...1.36&view=auto

Maybe a little note in the docs would save some
people 30-60 minutes of their sparetime.

Thomas

Jul 18 '05 #1
1 2509
Thomas Guettler wrote:
Hi,

The CGIHTTPServer returns

self.send_respo nse(200, "Script output follows")

before it starts the cgi process. This means
you cannot set the status header to 302 for
a redirect.

I don't see a easy and portable way to fix this.

CGIHTTPServer.p y:
http://cvs.sourceforge.net/viewcvs.p...1.36&view=auto

Maybe a little note in the docs would save some
people 30-60 minutes of their sparetime.

Thomas

If you'd spent the time it took to post your message posting a doc patch
instead then you'd have saved us boith some time ;-)

regards
Steve
--
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3348
by: William D. Gill | last post by:
I use a notebook (win 98) because of its portability. Unfortunately it is very slow. When I try to develop and test python cgi scripts I use Xitami as a local server, but with python, Xitami, and my text editor running it becomes next to impossible to work. The keyboard and mouse are slowed to painful levels. Actual execution of the webpage/script is tolerable, but to edit I have to stop the server. I was wondering if using...
1
2455
by: Sullivan | last post by:
When I run a CGI script (Python) with Python's CGIHTTPServer, it should run with the UID of the user 'nobody' (as the documentation says). But if I let the CGI script e.g. create a file, it creates the file with the UID of the user who started the CGIHTTPServer. Any ideas what I am doing wrong here? Thanks in advance for your help!
1
2009
by: Johann Blake | last post by:
Hi, I have come across a rather bizarre problem using the TcpClient to retrieve a web page. I use the TcpClient in conjunction with a StreamWriter to write a HTTP request to the web site. The web server returns either a 301, 302 or 404 code indicating that the page could not be found or has been redirected. If I issue the same URL using Internet Explorer (IE), it does retrieve the page. I then used a HTTP sniffer program to see what...
1
1855
by: craigkenisston | last post by:
Hi, I recently read a lot about a topic called page hijacking. It seems that you can steal page rank from search engines while doing a redirect. I reminded I had a code in some pages, where someone clicks a link on my site, I first go to a page to save the link, then I have a redirect to the site (I want to count this clicks out).
4
1665
by: Stan Canepa | last post by:
I have a web app that works fine on the development machine and on several servers running Win2k IIS 5 and Windows2003 IIS 6. But I am having an issue on one particular erver running Win2k IIS 5, but has an Apache server sending redirects to this server. My problem is when I try to do a Response.Redirect ("~/somepage.aspx") The page calling the Response.Rediect is in the same directory as the
1
1358
by: ThunderMusic | last post by:
Hi, I want to use a class (if possible other than Socket) which one I could call a custom handler and receive the redirect code it sends... Actually, I tried using the WebClient class, but when the WebClient is redirected, it does not give the redirect code in the result, it automaticaly redirects and put the resulting page into the result... Is there a buit-in class that does what I need in the .Net Framework or will I have to...
1
2420
by: Ronald Green | last post by:
Hi all, I'm trying to write a js function that uses XMLHttpRequest against a web application. Sometimes I get a 302, and the XMLHttpRequest automatically redirects. What I want to accomplish is either: 1. Don't let it redirect but figure out that it wanted to, and get the
4
2459
by: Fernando Rodriguez | last post by:
Hi, I'musing urllib to download pages from a site. How can I detect if a given url is being redirected somewhere else? I want to avoid this, is it possible? Thanks in advance!
1
6922
by: mpc | last post by:
hello, how does one run a PHP page with a python webserver? Lets say i have a simple python web server running /path/webserver.py #!/usr/bin/env python from BaseHTTPServer import HTTPServer from CGIHTTPServer import CGIHTTPRequestHandler serve = HTTPServer(("",8080),CGIHTTPRequestHandler)
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8494
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.