Odd slowcgi parsing behavior

2016-11-20 Thread Bob Jones
Does slowcgi somehow interfere with normal Perl parsing ?  (OpenBSD 6)

I have a simple Perl Script as follows :

===
#!/usr/bin/perl
use 5.014;
use strict;
use warnings;
use autodie;
my $header = << 'END_HEADER';




Test


END_HEADER
print $header;
==


Running this on the CLI yields the result as expected :






Test


=

However running this via slowcgi, the first line gets stripped out :

==



Wifi


Incorrect parameters



What's going on ???



Re: Odd slowcgi parsing behavior

2016-11-21 Thread Robert Klein
Hi,

RFC3875 section 6.2.1 says:

"The [CGI] script MUST return a Content-Type header field"

So your $header oughta be something like

my $header = << 'EOF';
Content-Type: text/html


...
EOF


Best regards
Robert


On Sun, 20 Nov 2016 13:54:39 +
Bob Jones  wrote:

> Does slowcgi somehow interfere with normal Perl parsing ?  (OpenBSD 6)
> 
> I have a simple Perl Script as follows :
> 
> ===
> #!/usr/bin/perl
> use 5.014;
> use strict;
> use warnings;
> use autodie;
> my $header = << 'END_HEADER';
> 
> 
> 
> 
> Test
> 
> 
> END_HEADER
> print $header;
> ==
> 
> 
> Running this on the CLI yields the result as expected :
> 
> 
> 
> 
> 
> 
> Test
> 
> 
> =
> 
> However running this via slowcgi, the first line gets stripped out :
> 
> ==
> 
> 
> 
> Wifi
> 
> 
> Incorrect parameters
> 
> 
> 
> What's going on ???



Re: Odd slowcgi parsing behavior

2016-11-21 Thread Bob Jones
Thanks Robert, will give it a go !