Skip to content

Fix/browser content length compatibility #102

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

Closed
wants to merge 5 commits into from

Conversation

hussnainzafar
Copy link
Contributor

Closes #

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CHANGELOG.md has been updated (for bug fixes / features / docs)

What kind of change does this PR introduce?

Bug fix

What was changed?

Modified how Content-Length headers are handled in browser environments:

  • Added browser detection in Bucket.update, Record.write, and Batch operations
  • Implemented fetch API with empty Blob for browser environments
  • Maintained Axios with Content-Length header for Node.js environments

Related issues

(Add links to related issues)

Does this PR introduce a breaking change?

No, this PR maintains backward compatibility while adding browser support.

Other information:

This fix addresses browser security restrictions that prevent setting the Content-Length header directly, which was causing 422 errors when updating labels in browser environments.

@hussnainzafar hussnainzafar requested a review from atimin April 24, 2025 09:07
@atimin atimin deleted the fix/browser-content-length-compatibility branch May 27, 2025 10:02
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.

2 participants