[ https://issues.apache.org/jira/browse/HTTPCLIENT-2118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17205446#comment-17205446 ]
Michael Lee commented on HTTPCLIENT-2118: ----------------------------------------- I've updated my demo project a bit (re-attached) to output the wire log (newly attached). It's about 20 MB in size unzipped because one of the URLs is a large file and the server actually returns 200 together with the file in the response body instead of just 304, despite my If-Modified-Since header value being later than the server's Last-Modified header value. I've also reduced the list of URLs a bit and still manged to reproduce the error. Interestingly, if you remove the 2nd URL from the list (that big file), both 4.5.x and 5.0.x return 304 for the last URL. Else 4.5.x returns 304 and 5.0.x returns 403 for the last URL: # [https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v7.9/npp.7.9.Installer.x64.exe] # [https://nginx.org/download/nginx-1.19.3.zip] # [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html] # [https://winscp.net/eng/download.php] # [https://curl.haxx.se/windows/] # [https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe] > Difference in behavior between 4.5.x and 5.0.x - CloseableHttpClient returns > 403 after NoHttpResponseException > -------------------------------------------------------------------------------------------------------------- > > Key: HTTPCLIENT-2118 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2118 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient (classic), HttpClient (Windows) > Affects Versions: 5.0.2 > Environment: Microsoft Windows 10 version 2004 [10.0.19041.508] > Oracle JDK 11.0.8 > Reporter: Michael Lee > Priority: Major > Attachments: demo.zip, test_output.txt, wire.log.zip > > > My application reuses an instance of CloseableHttpClient to retrieve the > content from a list of URLs. After upgrading HttpClient from 4.5.x to 5.0.2 > (also 5.0 and 5.0.1), it always gets a NoHttpResponseException followed by a > response code of 403 for a particular URL in the list. When using 4.5.x, it > always gets a 200 or 304 for that particular URL. > The behavior may be different if the order of the URLs in the list is changed. > To illustrate the problem, I have extracted code from my application into the > sample Maven project attached. In the JUnit test, testHttpClient4() will get > either 200 or 304 for all the URLs. On the other hand, testHttpClient5() > always gets 403 for the last URL in the list. In this project, I > intentionally added a If-Modified-Since header with the value being current > time minus 1 minute so that we should get a 304 from most of the URLs. > Can you investigate if this is really an obscure bug or an undocumented > behavior change related to how CloseableHttpClient handles redirects? > Thanks. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org