Skip to content
Snippets Groups Projects
Commit 35bfcd1d authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

handle headers from perl code, not templates

parent 78387890
Branches
Tags
No related merge requests found
...@@ -164,6 +164,11 @@ sub respond { ...@@ -164,6 +164,11 @@ sub respond {
binmode(STDOUT, ":utf8"); binmode(STDOUT, ":utf8");
print $self->{cgi}->header(
-type => 'text/html',
-charset => ''
);
unless ($tt2->process($template, $self->{out}, \*STDOUT)) { unless ($tt2->process($template, $self->{out}, \*STDOUT)) {
printf "Content-type: text/plain\n\n Error: %s", $tt2->error(); printf "Content-type: text/plain\n\n Error: %s", $tt2->error();
$self->{logger}->errorf("Web parser error : %s", $tt2->error()); $self->{logger}->errorf("Web parser error : %s", $tt2->error());
......
...@@ -23,7 +23,7 @@ subtest start_page => sub { ...@@ -23,7 +23,7 @@ subtest start_page => sub {
diag($out) if $ENV{TEST_DEBUG}; diag($out) if $ENV{TEST_DEBUG};
like( like(
$out, $out,
qr{^Content-Type: text/html\n\n}, qr{^Content-Type: text/html\r\n\r\n},
'HTTP headers' 'HTTP headers'
); );
like( like(
...@@ -50,7 +50,7 @@ subtest sp_selection_page => sub { ...@@ -50,7 +50,7 @@ subtest sp_selection_page => sub {
diag($out) if $ENV{TEST_DEBUG}; diag($out) if $ENV{TEST_DEBUG};
like( like(
$out, $out,
qr{^Content-Type: text/html\n\n}, qr{^Content-Type: text/html\r\n\r\n},
'HTTP headers' 'HTTP headers'
); );
like( like(
......
Content-Type: text/html
[% IF cookie %]Set-Cookie: [% cookie %][% END %]
<?xml version="1.0" encoding="utf-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/x <?xml version="1.0" encoding="utf-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/x
html1/DTD/xhtml1-transitional.dtd"> html1/DTD/xhtml1-transitional.dtd">
......
Content-Type: text/html
[% IF cookie %]Set-Cookie: [% cookie %][% END %]
<?xml version="1.0" encoding="utf-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/x <?xml version="1.0" encoding="utf-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/x
html1/DTD/xhtml1-transitional.dtd"> html1/DTD/xhtml1-transitional.dtd">
<html xml:lang="[% iso639 = locale.match('^(.)(.)'); iso639.0; iso639.1 %]" xmlns="http://www.w3.org/1999/xhtml"> <html xml:lang="[% iso639 = locale.match('^(.)(.)'); iso639.0; iso639.1 %]" xmlns="http://www.w3.org/1999/xhtml">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment