-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
99% of the time I create an HTTP::Response I forget to set the Content-Length header, thus stalling the HTTP pipeline. To fix this one simply has to remember to
$resp->content_length( length $resp->content );Which is reasonable enough if you have the response in a variable. However, #135 wishes to add chaining mutators in order to support fully-constructing a response object in a single expression without needing such a temporary. Without it it becomes hard to fix the content length.
I'd therefore suggest either a special "fix the content length" method, or else the default behaviour of a ->set_content_length method with no additional arguments, to do this.
return HTTP::Response->new( 200 )
->set_content( join "\n", @lines )
->set_content_length;Metadata
Metadata
Assignees
Labels
No labels