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

v7.9.2 seems to introduce CORS issue with Firebase Storage #2695

Closed
lupas opened this issue Feb 28, 2020 · 4 comments · Fixed by #2696
Closed

v7.9.2 seems to introduce CORS issue with Firebase Storage #2695

lupas opened this issue Feb 28, 2020 · 4 comments · Fixed by #2696
Assignees

Comments

@lupas
Copy link
Contributor

lupas commented Feb 28, 2020

Describe your environment

  • Operating System version: Mac OS Catalina 10.15.3 (19D76)
  • Browser version: 80.0.3987.122 (Official Build) (64-bit)
  • Firebase SDK version: 7.9.2
  • Firebase Product: Storage

Describe the problem

With 7.9.2, Firebase Storage .put() throws the following CORS error on localhost:

Access to fetch at 'https://firebasestorage.googleapis.com/v0/b/appId.appspot.com/o?name=_userdata%2FYixPa2SRSiRZ6OaYrDJN9cFLL6t1%2FuserPic.jpg'
from origin 'http://localhost:3000' has been blocked by CORS policy:
Request header field x-firebase-gmpid is not allowed by Access-Control-Allow-Headers
in preflight response.

Also see StackOverflow issue here.

Same code works with 7.9.1.

Steps to reproduce:

Seems to appear anytime put(), putString() and so on is called to upload a file to Firebase Storage.

Relevant Code:

Example:

async upload(base64Img, metadata, path) {
  const storageRef = storage.
    .ref()
    .child(`${path}/photo.jpg`)

  try {
    await storageRef.putString(base64Img, 'base64', metadata)
  } catch (e) {
    // handle error
  }
}
@lupas lupas changed the title [BUG] 7.9.2 CORS issue with Firebase Storage v7.9.2 seems to introduce CORS issue with Firebase Storage Feb 28, 2020
@SarhadSalam
Copy link

I was facing the same issue too, I am almost confident the error is in 7.9.2 version of the SDK. With 7.9.0 (the version I am using), my resources are fetched properly.

@lupas
Copy link
Contributor Author

lupas commented Feb 28, 2020

I was facing the same issue too, I am almost confident the error is in 7.9.2 version of the SDK. With 7.9.0 (the version I am using), my resources are fetched properly.

Yes agreed, error did not appear in v7.9.1, v7.9.0 and before.

@schmidt-sebastian
Copy link
Contributor

The next release should unblock these requests again. For now, please stay with 7.9.1.

@schmidt-sebastian
Copy link
Contributor

Fixed in 7.9.3.

@firebase firebase locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants