Re: [users@httpd] Error when issuing a 302 from a CGI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> I have a tiny CGI program written in C that's like this :
> 
> # include <stdio.h>
> main()
> {
>     printf("HTTP/1.1 302 Found\n");
>     printf("Location: http://www.unimep.br\n\n";);
> }
> 
> Running it at the prompt, it will print of course :
> 
> HTTP/1.1 302 Found
> Location: http://www.unimep.br
> 
> 
> However, when I run it from the browser I'll receive an "Internal Server 
> Error".
> 
> Error.log tells me this :
> 
> malformed header from script. Bad header=HTTP/1.1 302 Found: TEST080.exe
> 
> What's wrong ?

I may be wrong, but I think your double \n\n needs to come in the 
first line with the 'HTTP'

////jerry

> 
> -- 
> Obrigado,
> ------------------------------------------------------------------------------
>                 Jose Adriano Baltieri - Analista de Sistemas
>                 DTI - CENTRO - UNIMEP - Universidade Metodista de Piracicaba
>                 PIRACICABA - SP - Brasil - Fone : (19) 3124-1858
> ------------------------------------------------------------------------------

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux