Skip to content

Fixed issue where storage wasn't passing cookies when using firebase Studio #9111

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 8 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brown-pens-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/storage": patch
---

Fixed issue where Storage on Firebase Studio throws CORS errors.
2 changes: 1 addition & 1 deletion packages/storage/src/platform/browser/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ abstract class XhrConnection<T extends ConnectionType>
if (this.sent_) {
throw internalError('cannot .send() more than once');
}
if (isCloudWorkstation(url) && isUsingEmulator) {
if (isCloudWorkstation(new URL(url).hostname) && isUsingEmulator) {
this.xhr_.withCredentials = true;
}
this.sent_ = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/test/browser/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Connections', () => {
const fakeXHR = useFakeXMLHttpRequest();
const connection = new XhrBytesConnection();
const sendPromise = connection.send(
'https://abc.cloudworkstations.dev',
'https://abc.cloudworkstations.dev/test',
'GET',
true
);
Expand Down
Loading