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 storage admin sdk content type #5229

Merged
merged 6 commits into from Nov 10, 2022

Conversation

Yuangwang
Copy link
Contributor

Description

Fixes the content type admin sdk issues mentioned here #4982

Scenarios Tested

Tested via nodejs admin sdk and python gcs sdk. Also added new tests for this specific issue

Copy link
Contributor

@tonyjhuang tonyjhuang left a comment

Choose a reason for hiding this comment

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

two small comments, overall lgtm thanks for the fix!

@@ -251,6 +251,26 @@ describe("GCS endpoint conformance tests", () => {
expect(returnedMetadata.contentType).to.equal(customMetadata.contentType);
expect(returnedMetadata.contentDisposition).to.equal(customMetadata.contentDisposition);
});

it("should upload content type properly from x-upload-content-type headers", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a test for the media upload protocol above as well?

@@ -44,7 +44,7 @@ export type MediaUploadRequest = {
export type MultipartUploadRequest = {
bucketId: string;
objectId: string;
metadataRaw: string;
metadataRaw: object;
Copy link
Contributor

Choose a reason for hiding this comment

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

small nit: can you rename this metadata if we're passing in the object

@codecov-commenter
Copy link

Codecov Report

Base: 56.27% // Head: 56.27% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (068bc73) compared to base (dc44460).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5229   +/-   ##
=======================================
  Coverage   56.27%   56.27%           
=======================================
  Files         309      309           
  Lines       20813    20815    +2     
  Branches     4223     4223           
=======================================
+ Hits        11712    11714    +2     
- Misses       8088     8089    +1     
+ Partials     1013     1012    -1     
Impacted Files Coverage Δ
src/emulator/storage/apis/firebase.ts 4.51% <ø> (ø)
src/emulator/storage/apis/gcloud.ts 5.39% <0.00%> (-0.06%) ⬇️
src/emulator/storage/upload.ts 66.12% <ø> (ø)
src/emulator/auth/state.ts 85.43% <0.00%> (+0.56%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

None yet

4 participants