Skip to content

Fix signature mismatch bug due to max size bytes header #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 2, 2025

Conversation

thclark
Copy link
Contributor

@thclark thclark commented Jun 2, 2025

Summary

In the previous release 0.18.0, the addition of the X-Goog-Content-Length-Range header was "fixed". Previously it had been incorrectly added and was thus always missing.

However, this header must be identically both:

  • Encoded into signature generation and
  • Set on the upload request

The "fix" in 0.18.0 added it into the encoding of the signature generation but did not set it on the upload request. The resulting code caused errors in all uploads using the widget.

This release fixes that problem by clarifying the default value and ensuring that the correct header is set on upload. In the event that the requested max_size_bytes is 0, the upload size is unlimited.

This release adds a setting GCP_STORAGE_BLOBFIELD_MAX_SIZE_BYTES allowing you to set a maximum for all your blobfields. However, to avoid a breaking change, the default is set to 0 (unlimited).

Contents (#86)

Fixes

  • Correctly implement of max_size_bytes to avoid signature mismatch

Operations

  • Update ruff to sort imports in precommit
  • Update to latest stack

Style

  • Format all files per pre-commit specs

@thclark thclark merged commit fd59b2b into main Jun 2, 2025
3 of 4 checks passed
@thclark thclark deleted the fix-maxsize-bytes branch June 2, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant