Skip to content
New issue

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

If not handleContenttype it buffers entire content #64

Closed
rlk833 opened this issue Feb 2, 2018 · 0 comments
Closed

If not handleContenttype it buffers entire content #64

rlk833 opened this issue Feb 2, 2018 · 0 comments

Comments

@rlk833
Copy link

rlk833 commented Feb 2, 2018

IF I'm reading line 166 correctly:

if len(w.buf) >= w.minSize && handleContentType(w.contentTypes, w) && w.Header().Get(contentEncoding) == "" {

Then even if the buffer accumulates to over the minsize but it fails contenttype or content coding is set it will buffer the entire output stream before writing it out at close.

The handlecontenttype and get(contentencoding) should be the very first test on the first write and if it fails then from then on just flush directly to the real response writer and don't buffer anymore since these settings can't change once the writing has started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant