Repository navigation
Conversation
The existing emulator cases use localhost, which the parser already allows. These tests use the host the Storage emulator listens on.
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds integration and unit tests to verify that Firebase Storage correctly parses and accepts emulator download URLs using the 127.0.0.1 IP address. Specifically, it introduces a new integration test in instance_e2e.dart and a corresponding unit test in utils_test.dart, while also refactoring an existing localhost parsing test. I have no feedback to provide as there are no review comments and the changes are well-implemented.
The emulator puts 127.0.0.1 or a LAN address in getDownloadURL. Match the download path instead of allowing only localhost and 10.0.2.2.
SelaseKay
marked this pull request as ready for review
November 19, 2026 15:17
demolaf
approved these changes
Nov 20, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
FirebaseStorage.refFromURLrejected a Storage emulator download URL when the host was127.0.0.1. The emulator listens on that address, andgetDownloadURLfrom a client connected to it returnshttp://127.0.0.1:9199/v0/b/<bucket>/o/<object>?alt=media&token=.... The parser only treatedlocalhostand10.0.2.2as emulator hosts, so this URL was parsed as a Cloud Storage URL, did not match, and the call threw.partsFromHttpUrlnow treats anyhttporhttpsURL whose path is/v<version>/b/<bucket>/o/<object>as a Firebase Storage download URL, on whatever host and port it uses. Cloud Storage URLs onstorage.googleapis.comandstorage.cloud.google.comthat do not use that path are unchanged.Fixes #18988
Related Issues
refFromURLfails when using firebase emulator #18988Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
Test plan
flutter test test/utils_test.dart test/firebase_storage_test.dartinpackages/firebase_storage/firebase_storagepasses, including127.0.0.1,https, a LAN address, and[::1].accepts a Storage emulator download URL from 127.0.0.1.