Revlin John
2013-04-21 20:58:06 UTC
Hi,
Probably not many are running Mojolicious as a CGI script, but I'm testing
it out on a LAMP server with Firefox as my client. Here's the script:
#!/usr/bin/perl
Content-Type: text/html;charset=UTF-8
X-Powered-By: Mojolicious (Perl)
Status: 200 OK
Date: Sun, 21 Apr 2013 20:50:41 GMT
Content-Length: 137
<!DOCTYPE html>
<html><head>
<title>Mojolicious Title App</title>
</head>
<body>
Mojolicious: 2.23 <br />
Reading:
</body></html>
So, somehow the http headers are not being treated as headers by the
client, but rather plain text which is rendered on screen. How do I fix
this?
Thanks,
Rev
Probably not many are running Mojolicious as a CGI script, but I'm testing
it out on a LAMP server with Firefox as my client. Here's the script:
#!/usr/bin/perl
use warnings;
use strict;
use CGI::Carp qw(fatalsToBrowser);
use Mojolicious::Lite;
my $app = app;
my $version = Mojolicious->VERSION;
get '/' => sub {
$self->render( inline => <<HTML );
<!DOCTYPE html>
<html><head>
<title>Mojolicious Title App</title>
</head>
<body>
Mojolicious: $version <br />
</body></html>
HTML
};
$app->start('cgi');
And here's what I see in my browser:use strict;
use CGI::Carp qw(fatalsToBrowser);
use Mojolicious::Lite;
my $app = app;
my $version = Mojolicious->VERSION;
get '/' => sub {
$self->render( inline => <<HTML );
<!DOCTYPE html>
<html><head>
<title>Mojolicious Title App</title>
</head>
<body>
Mojolicious: $version <br />
</body></html>
HTML
};
$app->start('cgi');
Content-Type: text/html;charset=UTF-8
X-Powered-By: Mojolicious (Perl)
Status: 200 OK
Date: Sun, 21 Apr 2013 20:50:41 GMT
Content-Length: 137
<!DOCTYPE html>
<html><head>
<title>Mojolicious Title App</title>
</head>
<body>
Mojolicious: 2.23 <br />
Reading:
</body></html>
So, somehow the http headers are not being treated as headers by the
client, but rather plain text which is rendered on screen. How do I fix
this?
Thanks,
Rev
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.