Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] outputting HTML from REBOL cgi script

From: peoyli::algonet::se at: 20-Feb-2001 13:46

Hi, I got a strange problem while experimenting with REBOL CGI's.... The problem occurs with both version 2.3 and the latest experimental version of core (2.4.40.1.1) It seems like REBOL is adding its own 'Content-type' header, so that all REBOL CGI script output is text/plain (and therefor is useless for HTML output).. Perl cgi's work fine, so I doubt my server configuration is incorrect. If I telnet to the web server and manually enters the request, I get the following: bash-2.03$ telnet 172.16.0.3 80 Trying 172.16.0.3... Connected to 172.16.0.3. Escape character is '^]'. GET /frida-molle/showpic.cgi?pic=3 HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 20 Feb 2001 13:29:33 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Content-Type: text/html Connection: close Content-Type: text/plain <HTML> <HEAD> <TITLE> ..... ... The first content-type is the one I have in the script, and the second seems to come from REBOL itself. Very minimal script to reproduce the problem: --- #!/usr/local/bin/rebol --cgi REBOL [ Title: "CGI test script" ] print "Content-Type: text/html^/^/" print { <HTML><HEAD><TITLE>Just testing</TITLE></HEAD> <BODY BGCOLOR="white"> Just testing, minimal REBOL cgi script </BODY> </HTML> } --- and the manual HTTP request I send through telnet: GET /frida-molle/test-cgi.cgi HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 20 Feb 2001 13:38:48 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Content-Type: text/html Connection: close Content-Type: text/plain ... If I on the other site tries to access a page that do not exist, I get: GET /nonexistant-page.txt HTTP/1.0 HTTP/1.1 404 Not Found Date: Tue, 20 Feb 2001 13:40:30 GMT Server: Apache/1.3.14 (AMIGA) PHP/4.0.4 PHP/4.0.4 Connection: close Content-Type: text/html; charset=iso-8859-1 ... So.. where's the problem ? /PeO -- /* PeO - AMiGA owner since 1990, CGI, Perl, Assembly language & HTML-fanatic *\ \* Amiga 4000TE/060-50/604e 200, 146Mb, 33.4Gb, ZIP, JAZ, CVPPC/8 */ /* IIyama VM Pro 21", CP-SW2 Subwoofer system, NEC-222 *\ \* Plextor 12-Plex, Yamaha CRW 4416S, Artec A6000C+, Stylus Color 500 */ /* Lightfax 3660, Catweazel Z-II (3*IDE, 1*PC Floppy), Minolta DImage V *\ \* SCSI-Tower, Seagate Tapestor 4/8GB, Ariadne Ethernet, Minolta PagePro 6 */