>
> Is there an example available how this can or should be done?
>

It's not officially supported anymore. Didn't even make it into the 1.0 
release, since the code was too complicated and literally nobody used it.

    https://github.com/kraih/mojo/blob/v0.999920/t/mojo/app.t#L12

There used to be a continue_handler in the app class, which you could 
define to send other response codes than 100.

   https://github.com/kraih/mojo/blob/v0.999920/lib/Mojo/Server.pm#L49

Which would get called by the server if it exists.

  
  https://github.com/kraih/mojo/blob/v0.999920/lib/Mojo/Server/Daemon.pm#L229

And i don't think there's an elegant way to make it work today, you'd have 
to hook into request parser events (possibly "body" in Mojo::Content) and 
write your 100 response directly to the stream with Mojo::IOLoop.

    # Completely untested
    use Scalar::Util;
    hook after_build_tx => sub {
      my ($tx, $app) = @_;
      Scalar::Util::weaken $tx;
      $tx->req->content->on(body => sub {
        return unless my $expect = $tx->req->headers->expect;
        ...
        if (...) {
          Mojo::IOLoop->stream($tx->connection)->write("100 
Continue\r\n\r\n");
        }
        else {
          $tx->req->error({message => 'We do not like this request'});
        }
      });
    };

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to