jonathanstowe / raku-fastcgi-nativecall

An implementation of FastCGI using NativeCall
Other
5 stars 3 forks source link

method header should print Status header first #4

Closed zopsicle closed 4 years ago

zopsicle commented 4 years ago

The Status header should be the first header for compatibility with some servers such as Caddy. Currently headers are printed in whatever order the hash puts them in.

Example:

$fcgi.header(Status => 404, Content-Type => 'text/html');
# Sometimes Status comes last because Hash has an unpredictable order.
jonathanstowe commented 4 years ago

Yeah that's fixable, have you got a sample configuration for e.g. caddy so I can test this?

zopsicle commented 4 years ago

Nevermind! I was misusing the API, like this:

$fcgi.header(Status => 404, $header);

But this passes Status as a argument, not as a pair, and apparently hash slurping does not work that way.

Solution:

$fcgi.header(Status => 404, |$header);