ok2c commented on code in PR #461:
URL: 
https://github.com/apache/httpcomponents-client/pull/461#discussion_r1244142904


##########
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ResponseCachingPolicy.java:
##########
@@ -495,4 +503,23 @@ boolean responseContainsNoCacheDirective(final 
ResponseCacheControl responseCach
         return false;
     }
 
+    /**
+     * This method checks if a given HTTP status code is understood according 
to RFC 7231.
+     * Understood status codes include:
+     * - All 2xx (Successful) status codes (200-299)
+     * - All 3xx (Redirection) status codes (300-399)
+     * - All 4xx (Client Error) status codes up to 417 and 421
+     * - All 5xx (Server Error) status codes up to 505
+     *
+     * @param status The HTTP status code to be checked.
+     * @return true if the HTTP status code is understood, false otherwise.
+     */
+    private boolean understoodStatusCode(final int status) {
+        return (status >= 200 && status <= 299)   ||    // All 2xx status codes

Review Comment:
   @arturobernalg That is probably too bold. I would go with 200 up to 206 only.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to