We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using Starman as the backend HTTP server for a PSGI app, and need to use a Trailer header, e.g.:
<Response Headers> Trailer: X-Payload-Signature <Response Body> X-Payload-Signature: 330cce9978d4682f
Right now, Starman does not support trailer headers (https://tools.ietf.org/html/rfc7230#section-4.1.2) with chunk-encoded server responses.
Would there be any interest in a simple addition to support this?
A very rough idea for a patch (minimally tested, so far):
diff --git a/lib/Starman/Server.pm b/lib/Starman/Server.pm index c2c6d77..468a778 100644 --- a/lib/Starman/Server.pm +++ b/lib/Starman/Server.pm @@ -550,8 +550,17 @@ sub _finalize_response { } _syswrite($conn, \$buffer); }, + trailer => sub { + $self->{trailer} = shift; + }, close => sub { - _syswrite($conn, \"0$CRLF$CRLF") if $chunked; + if ($chunked) { + _syswrite($conn, \"0$CRLF"); + if (my $trailer = delete $self->{trailer}) { + _syswrite($conn, \"$trailer$CRLF"); + } + _syswrite($conn, \"$CRLF"); + } }; } }
I will work on a PR and unit tests, if there is interest.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using Starman as the backend HTTP server for a PSGI app, and need to use a Trailer header, e.g.:
Right now, Starman does not support trailer headers (https://tools.ietf.org/html/rfc7230#section-4.1.2) with chunk-encoded server responses.
Would there be any interest in a simple addition to support this?
A very rough idea for a patch (minimally tested, so far):
I will work on a PR and unit tests, if there is interest.
The text was updated successfully, but these errors were encountered: