[dancer-users] Non-blocking stuff

David H untg99 at gmail.com
Tue Nov 17 03:26:22 GMT 2015


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;


   };
};

Notice the "session 'Username' => $Username."

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??

Thanks,

David



On Tue, Nov 17, 2015 at 11:43 AM, Warren Young <wyml at etr-usa.com> wrote:

> On Nov 16, 2015, at 6:09 PM, David H <untg99 at gmail.com> wrote:
> >
> >     add_header 'X-Foo' => 'Bar’;
>
> That’s probably an old DSL keyword.  It looks like it was replaced with
> ‘header’:
>
>
> https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Manual.pod#header
>
> 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.
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20151117/8f122f0c/attachment.html>


More information about the dancer-users mailing list