Thanks,
I've changed the custom headers.
There is something which is causing a "400 Bad Response".
I've narrowed it down to this simple use case:
get '/Load/:ID' => sub {
my $ID = params->{'ID'};
delayed {
my $TextToWrite = ReturnText(); # Just returns "hi", works fine.
my $Username = "Test";
session 'Username' => $Username; # Causes the whole thing to to return "400 Bad Response" and not work at all.
header 'Content-Type' => "text/html; charset=UTF-8";
flush;
content "$TextToWrite";
done;
};
};
That causes a "400 Bad Response" error. I'm guessing something to do with the session being set and returning before other stuff has happened??