Skip to content
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

feat: allow cors header to be excluded from request headers #489

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

kevinpagtakhan
Copy link
Contributor

@kevinpagtakhan kevinpagtakhan commented Jan 20, 2022

Summary

A change was introduce in v8.7.0 that enforces cors in request headers by default. There isn't a way to remove it for users who do not need it. This change allows cors to be removed from request headers by passing '', null, undefined to config.headers['Cross-Origin-Resource-Policy'] on init.

CODE SAMPLE
amplitude.getInstance().init(<API_KEY>, <USER_ID>, {
  headers: {
    'Cross-Origin-Resource-Policy': undefined,
  }
});

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

@kevinpagtakhan kevinpagtakhan marked this pull request as ready for review January 20, 2022 18:29
@kevinpagtakhan kevinpagtakhan self-assigned this Jan 20, 2022
Copy link
Contributor

@justin-fiedler justin-fiedler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kevinpagtakhan kevinpagtakhan merged commit 0119ac7 into main Jan 20, 2022
@kevinpagtakhan kevinpagtakhan deleted the AMP-47682-option-to-remove-cors-header branch January 20, 2022 19:22
@ekanth
Copy link

ekanth commented Jan 20, 2022

Thanks for addressing this @kevinpagtakhan and @ajhorst!

github-actions bot pushed a commit that referenced this pull request Jan 21, 2022
# [8.16.0](v8.15.1...v8.16.0) (2022-01-21)

### Bug Fixes

* catch errors with Request.send ([#490](#490)) ([333f8a4](333f8a4))

### Features

* accept custom session id paramter in config ([#485](#485)) ([b64b8b0](b64b8b0))
* allow cors header to be excluded from request headers ([#489](#489)) ([0119ac7](0119ac7))
@github-actions
Copy link

🎉 This PR is included in version 8.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants