jmarantz commented on issue #1785: Fix mismatch between decompression and headers URL: https://github.com/apache/incubator-pagespeed-mod/pull/1785#issuecomment-403078989 Still haven't been able to dive into the code, but I wonder if anyone who is experiencing the broken behavior would be willing to patch in this PR and give it a spin. On Fri, Jul 6, 2018, 10:38 AM Otto van der Schaaf <notificati...@github.com> wrote: > *@oschaaf* approved this pull request. > > One question, but that aside this looks great to me > ------------------------------ > > In net/instaweb/rewriter/resource.cc > <https://github.com/apache/incubator-pagespeed-mod/pull/1785#discussion_r200569035> > : > > > - StringWriter inflate_writer(&extracted_contents_); > - if (GzipInflater::Inflate(raw_contents(), GzipInflater::kGzip, > - &inflate_writer)) { > - extracted_ = true; > - } > + bool use_extracted = EnsureExtractedIfNeeded(); > + return use_extracted ? extracted_contents_ : raw_contents(); > +} > + > +const ResponseHeaders* Resource::UncompressedHeaders() const { > + bool use_extracted = EnsureExtractedIfNeeded(); > + return use_extracted ? extracted_headers_.get() : response_headers(); > +} > + > +bool Resource::EnsureExtractedIfNeeded() const { > + if (extracted_state_ == kExtractNotComputed) { > > I wonder what happens when response_headers_ gets changed after > extracted_state_ is computed. > If that is a valid case, perhaps this needs to reset extracted_state_ to > kExtractNotComputed when we observe response_headers_ is dirty / has been > modified? > > — > You are receiving this because your review was requested. > Reply to this email directly, view it on GitHub > <https://github.com/apache/incubator-pagespeed-mod/pull/1785#pullrequestreview-134910571>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AB2kPbcx7V49C-4ICruZVTPT4SC_X-wfks5uDxQSgaJpZM4U-env> > . >
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services