Skip to content

Commit

Permalink
🎨 🔧 fix flake8/black > change type() check method from using type to …
Browse files Browse the repository at this point in the history
…using isinstance()
  • Loading branch information
storkwrangler committed Oct 22, 2024
1 parent 55436a9 commit 629da5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zappa/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def encode_response(status, headers, exc_info=None):
new_headers = [
header
for header in headers
if ((type(header[0]) != str) or (header[0].lower() != "set-cookie"))
if isinstance(header[0], str) or header[0].lower() != "set-cookie"
]
cookie_headers = [
(header[0].lower(), header[1])
for header in headers
if ((type(header[0]) == str) and (header[0].lower() == "set-cookie"))
if isinstance(header[0], str) and header[0].lower() == "set-cookie"
]
new_headers = new_headers + cookie_headers

Expand Down

0 comments on commit 629da5e

Please sign in to comment.