I think there is a small bug in documentation of this new method
res->set_content_type(
'image/jpeg'
)->render_binary(
$content
);
should be:
$self->res->set_content_type(
'image/jpeg'
)->render_binary(
$content
);
Also, how can I specify the Content-Length of a binary resource? I was using this piece of code:
$self->res->set_code(200);
$self->res->set_content_type( $doc->mime );
$self->res->content_length( $doc->size );
$self->res->rendered(1);
$self->res->body( $doc->content->bytes );
Thanks,
Miguel