<div dir="ltr"><div><div><div><div><div>Thanks,<br></div>I've changed the custom headers.<br></div>There is something which is causing a "400 Bad Response".<br><br></div>I've narrowed it down to this simple use case:<br>get '/Load/:ID' => sub {<br> my $ID = params->{'ID'};<br> delayed {<br> my $TextToWrite = ReturnText(); # Just returns "hi", works fine.<br> my $Username = "Test";<br> session 'Username' => $Username; # Causes the whole thing to to return "400 Bad Response" and not work at all.<br> header 'Content-Type' => "text/html; charset=UTF-8";<br> flush;<br> content "$TextToWrite";<br> done;<br><br><br> };<br>};<br><br></div><div>Notice the "session 'Username' => $Username."<br><br></div><div>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??<br><br></div><div>Thanks,<br><br></div><div>David<br></div><div><br></div></div><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 17, 2015 at 11:43 AM, Warren Young <span dir="ltr"><<a href="mailto:wyml@etr-usa.com" target="_blank">wyml@etr-usa.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Nov 16, 2015, at 6:09 PM, David H <<a href="mailto:untg99@gmail.com">untg99@gmail.com</a>> wrote:<br>
><br>
> add_header 'X-Foo' => 'Bar’;<br>
<br>
That’s probably an old DSL keyword. It looks like it was replaced with ‘header’:<br>
<br>
<a href="https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Manual.pod#header" rel="noreferrer" target="_blank">https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Manual.pod#header</a><br>
<br>
Anyway, do you really need to set custom HTTP headers here? It’s just an example. If your app doesn’t need that, remove the line entirely.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</div></div></blockquote></div><br></div>