Skip to content

Commit

Permalink
✨ feat(main.py): update headers to include upload options for API req…
Browse files Browse the repository at this point in the history
…uest
  • Loading branch information
RagnarLothbrok-Odin committed Dec 11, 2023
1 parent c57a88d commit c901ba5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
USER_ACCESS_TOKEN = "<access_token>"
# The maximum allowable size for an individual file, specified in megabytes
MAX_FILE_SIZE_MB = 40
# A dictionary containing upload options for the Zipline API.
# For detailed information on available options, refer to the official documentation:
# https://zipline.diced.sh/docs/guides/upload-options
UPLOAD_OPTIONS = {"Format": "RANDOM", "Embed": "false"}


def validate_file(path):
Expand Down Expand Up @@ -82,7 +86,7 @@ def upload_file(self, event):
if not self.handle_array(event):
return

headers = {"Authorization": f"{USER_ACCESS_TOKEN}"}
headers = {"Authorization": USER_ACCESS_TOKEN, **UPLOAD_OPTIONS}
files = {
"file": (
basename(event.src_path),
Expand Down

0 comments on commit c901ba5

Please sign in to comment.