Skip to content

Commit cd6641f

Browse files
authored
Stop iterating fields once we find a match (#442)
1 parent bd17d3e commit cd6641f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/smithy-http/src/smithy_http/aio/restjson.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ async def parse_rest_json_error_info(
3030
for field in http_response.fields:
3131
if field.name.lower() == _REST_JSON_CODE_HEADER:
3232
code = field.values[0]
33+
break
3334

3435
if check_body:
3536
if body := await http_response.consume_body_async():

0 commit comments

Comments
 (0)