wwj6591812 commented on code in PR #8412:
URL: https://github.com/apache/paimon/pull/8412#discussion_r3522835238
##########
paimon-api/src/main/java/org/apache/paimon/rest/HttpClientUtils.java:
##########
@@ -107,8 +112,7 @@ public static boolean exists(String uri) throws IOException
{
}
int rangeStatusCode = getRangeStatusCode(uri);
if (rangeStatusCode == HttpStatus.SC_OK
- || rangeStatusCode == HttpStatus.SC_PARTIAL_CONTENT
- || rangeStatusCode ==
HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE) {
+ || rangeStatusCode == HttpStatus.SC_PARTIAL_CONTENT) {
Review Comment:
Thanks for the review, @JingsongLi.
You're right — removing SC_REQUESTED_RANGE_NOT_SATISFIABLE regressed the
zero-length object case: on GET-only servers, a Range: bytes=0-0 probe against
an empty object legitimately returns 416 and should still be treated as an
existing resource. I've restored the 416 branch in exists() and added back
testExistsTreatsEmptyResourceAsExistingWhenRangeReturns416. Related tests pass.
Please take another look when you have a chance.
--
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]