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
The transfer() method should resort to using chunked transfer encoding when no content length is passed.
transfer()
$ git diff diff --git a/src/main/php/org/oneandone/punktestand/Proxy.class.php b/src/main/php/org/oneandone/punktestand/Proxy.class.php index 58247da..1b1d80a 100755 --- a/src/main/php/org/oneandone/punktestand/Proxy.class.php +++ b/src/main/php/org/oneandone/punktestand/Proxy.class.php @@ -14,6 +14,16 @@ class Proxy implements \web\Handler { $attach= $this->api->attachment($path); $res->status($attach->status()); - $res->transfer($attach->stream(), $attach->header('Content-Type')); + $res->header('Content-Type', $attach->header('Content-Type')); + $res->header('Transfer-Encoding', 'chunked'); + + $in= $attach->stream(); + while ($in->available()) { + $chunk= $in->read(); + $res->write(sprintf("%x\r\n%s\r\n\r\n", strlen($chunk), $chunk)); + } + + $res->write("0\r\n"); + $in->close(); } } \ No newline at end of file
See https://tools.ietf.org/html/rfc2616#section-3.6.1
The text was updated successfully, but these errors were encountered:
c84b420
No branches or pull requests
The
transfer()
method should resort to using chunked transfer encoding when no content length is passed.See https://tools.ietf.org/html/rfc2616#section-3.6.1
The text was updated successfully, but these errors were encountered: