X
X
xuxubla2015-12-16 09:53:25
Perl
xuxubla, 2015-12-16 09:53:25

Why are HTTP headers overwritten in Perl?

print "Expires: Thu, 08 May 2003 08:37:25 GMT\n\n";
print "Content-Type: text/html; charset=windows-1251\n\n";

Only the first header is set, instead of the second it gives Content-Type: text/perl-x, plus Vary is overwritten.
Actually the purpose of all this is to install Expires. Can anyone help?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
krypt3r, 2015-12-16
@xuxubla

An empty string is the end of the headers and the beginning of the request body. Headers are separated by "\r\n", not "\n\n"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question