From: Jamie C. <jca...@we...> - 2013-07-24 07:01:29
|
I think you need to replace the + in those print statements with a . , which is what perl uses to combine strings. Krause Felix <Fel...@de...> wrote: >> Something like that should work - but you should remove the line that prints >> "HTTP/1.1 200 OK". This isn't necessary in any Webmin CGI script, as the >> webserver adds that line. The "500 Bad Header" error happens if your script's >> output doesn't start with valid HTTP headers. > >I changed it to: > >my $CRFL = "\x0d\x0a"; >my $client = HTTP::Client->new(); >my $content = $client->get("http://127.0.0.1:8888/io"); > >print "Date: " + time2str(localtime) + $CRLF; >print "Content-Type: text/json; Charset=iso-8859-1$CRLF"; >print "Content-Length: " + length($content); >print "$CRLF$CRLF$content"; > >I get the same 500 error. Afaik these are the only required headers for a http response. Do I need to add others to make it work? Is there a log where Webmin tells me what it doesn't like about my headers? (The action log is empty.) > >I would look what a normal index.cgi outputs, but I cannot execute it directly from the command line (it says that WEBMIN_CONFIG is not set). > >Regards, >Felix > >------------------------------------------------------------------------------ >See everything from the browser to the database with AppDynamics >Get end-to-end visibility with application monitoring from AppDynamics >Isolate bottlenecks and diagnose root cause in seconds. >Start your free trial of AppDynamics Pro today! >http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk >- >Forwarded by the Webmin development list at web...@we... >To remove yourself from this list, go to >http://lists.sourceforge.net/lists/listinfo/webadmin-devel > |