Skip to content

Commit

Permalink
Fix issue with adding random suffix to headers (#3)
Browse files Browse the repository at this point in the history
* Fix issue with adding random suffix to headers

* Update dump_headers function signature

* Fix issue with dump_headers function
  • Loading branch information
k-taro56 authored Apr 8, 2024
1 parent 7184eec commit ae3206b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vercel_storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def get_token(options: dict):
return _tkn


def dump_headers(options: dict, headers: dict):
def dump_headers(options: Optional[dict], headers: dict):
if options is None:
options = {}
if options.get("debug", False):
print(tabulate([(k, v) for k, v in headers.items()]))

Expand All @@ -54,7 +56,7 @@ def put(pathname: str, body: bytes, options: Optional[dict] = None) -> dict:
"cacheControlMaxAge", str(DEFAULT_CACHE_AGE)
),
}
if "no_suffix" in options:
if options and "no_suffix" in options:
headers["x-add-random-suffix"] = "false"

dump_headers(options, headers)
Expand Down

0 comments on commit ae3206b

Please sign in to comment.