Skip to content

Commit

Permalink
Use map headers instead of writing
Browse files Browse the repository at this point in the history
  • Loading branch information
emilong committed Dec 5, 2023
1 parent 239eb6d commit 462a7f1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/gcp_storage_emulator/handlers/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,8 @@ def batch(request, response, storage, *args, **kwargs):


def options(request, response, storage, *args, **kwargs):
response["Content-Type"] = "text/html; charset=UTF-8"
response["Allow"] = "OPTIONS,GET,POST,PUT,DELETE,PATCH"
response["Access-Control-Allow-Origin"] = "*"
response["Access-Control-Allow-Methods"] = "GET,POST,PUT,PATCH,DELETE,OPTIONS"
response.write("HTTP/1.1 200 OK\r\n")
response.write("Content-Type: text/html; charset=UTF-8\r\n")
response.write("Allow: OPTIONS,GET,POST,PUT,DELETE,PATCH\r\n")
response.write("Access-Control-Allow-Origin: *\r\n")
response.write(
"Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE,OPTIONS\r\n"
)

0 comments on commit 462a7f1

Please sign in to comment.