You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by catchsudheera <gi...@git.apache.org> on 2018/01/14 15:56:40 UTC

[GitHub] httpcomponents-client pull request #91: HTTPCLIENT-1690: Discarded any Conte...

GitHub user catchsudheera opened a pull request:

    https://github.com/apache/httpcomponents-client/pull/91

    HTTPCLIENT-1690: Discarded any Content-Encoding headers coming with 304 status

    Discarded any Content-Encoding headers coming with 304 status code while updating the cache entry. Update performed on cache entry is not updating the content, so we should not update the Content-Encoding header as well ( even if the 304 response has it)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/catchsudheera/httpcomponents-client remotes/upstream/4.5.x-HTTPCLIENT-1690

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/httpcomponents-client/pull/91.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #91
    
----
commit 494e3bffe5811750b8fcbd89d2af4485c549f86b
Author: Sudheera Palihakkara <ca...@...>
Date:   2018-01-14T15:49:50Z

    HTTPCLIENT-1690: Discarded any Content-Encoding header coming with 304 status code while updating the cache entry. Added a test case to test that scenario

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-client pull request #91: HTTPCLIENT-1690: Discarded any Conte...

Posted by catchsudheera <gi...@git.apache.org>.
Github user catchsudheera closed the pull request at:

    https://github.com/apache/httpcomponents-client/pull/91


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-client pull request #91: HTTPCLIENT-1690: Discarded any Conte...

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on a diff in the pull request:

    https://github.com/apache/httpcomponents-client/pull/91#discussion_r161406549
  
    --- Diff: httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntryUpdater.java ---
    @@ -103,6 +103,8 @@ public HttpCacheEntry updateCacheEntry(
     
         protected Header[] mergeHeaders(final HttpCacheEntry entry, final HttpResponse response) {
     
    +        // since we do not expect a content in the response, remove any related headers if exists
    +        response.removeHeaders(HTTP.CONTENT_ENCODING);
    --- End diff --
    
    @catchsudheera Sudheera, can we avoid mutation of the original response message? It would be cleaner to ignore this header when copying updated headers from the response message instead of deleting it from the original message itself. To make things easier you might want to port `mergeHeaders` method from master
    https://github.com/apache/httpcomponents-client/blob/master/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheUpdateHandler.java#L139


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-client issue #91: HTTPCLIENT-1690: Discarded any Content-Enco...

Posted by catchsudheera <gi...@git.apache.org>.
Github user catchsudheera commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/91
  
    @ok2c Actually, in master branch commit. you missed one change. Surprised why tests didn't fail and found out that test is not complete. Updated test case for 4.5.x and 4.6.x and added missing change for master branch. Sent separate PRs for each branch.. closing this PR


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-client issue #91: HTTPCLIENT-1690: Discarded any Content-Enco...

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/91
  
    @catchsudheera Committed to 4.5.x, 4.6.x and master. Please review and close this PR.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org