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

Fix issue where emulator throws an error due to non-standard whitespaces in filenames #7308

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

aalej
Copy link
Contributor

@aalej aalej commented Jun 11, 2024

Description

Fixes #6834

Encodes the Content-Disposition header. See reference's example section

Scenarios Tested

Tested the scenario:

  1. Opening the file with non-standard whitespace directly from console UI
  2. Downloading the file with non-standard whitespace via using a Web Application
  3. Uploading a file with non-standard whitespace that triggers onFinalize() Cloud Function which downloads the file

See https://github.com/aalej/issues-6834-pr-test

Scenario 1

  1. Run firebase emulators:start --project demo-project --import ./emulator-data
  2. Go to http://127.0.0.1:4000/storage/demo-project.appspot.com
  3. Click "invalid whitespace.png"
    • Image loads

Scenario 2

  1. Run firebase emulators:start --project demo-project --import ./emulator-data
  2. On a new terminal, run cd web-app, then npm run start
  3. Go to http://localhost:3000/
  4. Click "Download" button
    • Image is loaded on the UI

Scenario 3

  1. Run firebase emulators:start --project demo-project
  2. Go to http://127.0.0.1:4000/storage/demo-project.appspot.com
  3. Upload file located in ./images/invalid whitespace.png
    • Function finishes executing
i  functions: Beginning execution of "us-central1-firstGenGenerateThumbnail"
i  functions: Finished "us-central1-firstGenGenerateThumbnail" in 119.516208ms

Sample Commands

N/A

aalej added 3 commits June 11, 2024 22:10
…ce in filenames.
@joehan joehan self-requested a review June 11, 2024 17:34
Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

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

LGTM!

@joehan joehan merged commit d01da70 into master Jun 11, 2024
41 checks passed
@joehan joehan deleted the aalej-storage-em-rfc branch June 11, 2024 18:04
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.

Content-Disposition Header Error with Non-Standard Whitespace in Filenames in Storage Emulator
2 participants