From e98ce36301e916bdf559377a6af21b888db1cf45 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 17 Jan 2019 15:01:12 -0800 Subject: [PATCH] Tighten up HTTP response code check Previously s3fs considered 3xx codes as successful. When writing an object to a misconfigured region, s3fs did not propagate the 301 as a write error to the client. References #693. --- src/curl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/curl.cpp b/src/curl.cpp index 5c6c2ee..7d35c0d 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -2072,7 +2072,7 @@ int S3fsCurl::RequestPerform(void) S3FS_PRN_ERR("curl_easy_getinfo failed while trying to retrieve HTTP response code"); return -EIO; } - if(400 > LastResponseCode){ + if(LastResponseCode >= 200 && LastResponseCode < 300){ S3FS_PRN_INFO3("HTTP response code %ld", LastResponseCode); return 0; }