Skip to content

Commit 6cd77cb

Browse files
author
Siddharth Srivastava
committed
fix(middleware-sdk-s3): fixes returning 400 as the response code for all failed requests
1 parent a63f958 commit 6cd77cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/middleware-sdk-s3/src/throw-200-exceptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const throw200ExceptionsMiddleware =
1919
const { response } = result;
2020
if (!HttpResponse.isInstance(response)) return result;
2121
const { statusCode, body } = response;
22-
if (statusCode < 200 && statusCode >= 300) return result;
22+
if (statusCode < 200 || statusCode >= 300) return result;
2323

2424
// Throw 2XX response that's either an error or has empty body.
2525
const bodyBytes = await collectBody(body, config);

0 commit comments

Comments
 (0)