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

feat!: automatically detect contentType if not provided #1190

Merged
merged 5 commits into from
May 13, 2020
Merged

feat!: automatically detect contentType if not provided #1190

merged 5 commits into from
May 13, 2020

Conversation

atn
Copy link
Contributor

@atn atn commented May 12, 2020

Fixes #1184 🦕

In a rush, I didn't have time to edit tests.ts file. It would be appreciated if someone could!

@atn atn requested a review from a team as a code owner May 12, 2020 20:06
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label May 12, 2020
@atn
Copy link
Contributor Author

atn commented May 12, 2020

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels May 12, 2020
@stephenplusplus stephenplusplus self-assigned this May 12, 2020
@stephenplusplus
Copy link
Contributor

Thank you! I will take it over :)

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels May 12, 2020
@@ -3438,12 +3438,6 @@ class Bucket extends ServiceObject {
});
}

const contentType = mime.contentType(path.basename(pathString));
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed as this is identically covered inside of createWriteStream() when this code makes its way there.

@atn
Copy link
Contributor Author

atn commented May 13, 2020

@googlebot I consent.

@codecov
Copy link

codecov bot commented May 13, 2020

Codecov Report

Merging #1190 into master will increase coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1190      +/-   ##
==========================================
+ Coverage   99.17%   99.29%   +0.11%     
==========================================
  Files          12       12              
  Lines       11454    11474      +20     
  Branches      594      805     +211     
==========================================
+ Hits        11360    11393      +33     
+ Misses         94       81      -13     
Impacted Files Coverage Δ
src/bucket.ts 99.83% <ø> (+0.30%) ⬆️
src/file.ts 100.00% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a4044a...4e119d7. Read the comment docs.

@stephenplusplus stephenplusplus changed the title Automatically change contentType to auto if none provided. feat: automatically detect contentType if not provided May 13, 2020
@stephenplusplus stephenplusplus changed the title feat: automatically detect contentType if not provided feat!: automatically detect contentType if not provided May 13, 2020
@jkwlui jkwlui added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels May 13, 2020
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@jkwlui jkwlui added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 13, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 13, 2020
@stephenplusplus stephenplusplus removed the request for review from AVaksman May 13, 2020 20:39
@jkwlui jkwlui merged commit b31ba4a into googleapis:master May 13, 2020
BYK added a commit to getsentry/sentry-javascript that referenced this pull request Jan 4, 2021
This is to upgrade the vulnerable `date-and-time` dependency. The latest version has the following breaking changes which are all okay:

- automatically detect contentType if not provided (googleapis/nodejs-storage#1190)
- drop keepAcl parameter in file copy (googleapis/nodejs-storage#1166)
- drop support for node.js 8.x
- allow leading slashes in file name (googleapis/nodejs-storage#820)
- upgrade engines field to >=8.10.0 (googleapis/nodejs-storage#688)
BYK added a commit to getsentry/craft that referenced this pull request Jan 5, 2021
This is to upgrade the vulnerable `axios` dependency. The latest version has the following breaking changes which are all okay:

- automatically detect contentType if not provided (googleapis/nodejs-storage#1190)
- drop keepAcl parameter in file copy (googleapis/nodejs-storage#1166)
- drop support for node.js 8.x
- allow leading slashes in file name (googleapis/nodejs-storage#820)
- upgrade engines field to >=8.10.0 (googleapis/nodejs-storage#688)
BYK added a commit to getsentry/craft that referenced this pull request Jan 5, 2021
This is to upgrade the vulnerable `axios` dependency. The latest version has the following breaking changes which are all okay:

- automatically detect contentType if not provided (googleapis/nodejs-storage#1190)
- drop keepAcl parameter in file copy (googleapis/nodejs-storage#1166)
- drop support for node.js 8.x
- allow leading slashes in file name (googleapis/nodejs-storage#820)
- upgrade engines field to >=8.10.0 (googleapis/nodejs-storage#688)
BYK added a commit to getsentry/sentry-javascript that referenced this pull request Jan 11, 2021
This is to upgrade the vulnerable `date-and-time` dependency. The latest version has the following breaking changes which are all okay:

- automatically detect contentType if not provided (googleapis/nodejs-storage#1190)
- drop keepAcl parameter in file copy (googleapis/nodejs-storage#1166)
- drop support for node.js 8.x
- allow leading slashes in file name (googleapis/nodejs-storage#820)
- upgrade engines field to >=8.10.0 (googleapis/nodejs-storage#688)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically set content-type based on file type
5 participants