Repository navigation
Bucket.upload: charset not appended on application/javascript contentType #320
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone
Description
Activity
mime-typeslooks good to me. 👍- addedstatus: blockedResolving the issue is dependent on other work.Resolving the issue is dependent on other work.
on Dec 4, 2014 I'll wait a little bit to see how jshttp/mime-types#15 shakes out. In the meantime, you are free to use mime-types in your app, then set its value on the metadata object passed to .upload:
bucket.upload("file.js", { contentType: "result from mimetypes" }, function (err, file) {})
Thank you for your reply.
Thank you for the suggestion too, and yes, that's what I'm doing right now.
I'll be keeping track for the update and remove the unnecessary parts of mime-types codes in my app after the update.- added a commit that references this issue
on Dec 5, 2014 - removedstatus: blockedResolving the issue is dependent on other work.Resolving the issue is dependent on other work.
on Dec 5, 2014 - added a commit that references this issue
on Dec 8, 2014 - added 2 commits that reference this issue
on Dec 8, 2014 - addedapi: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
on Feb 2, 2015 - added🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
on Apr 6, 2020 41 remaining items
- added a commit that references this issue
on Jan 27, 2026 - added a commit that references this issue
on Feb 25, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 5, 2026 - added 2 commits that reference this issue
on Mar 9, 2026 - added a commit that references this issue
on Mar 11, 2026
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
I did
console.log(metadata)on Bucket.upload API. and charset=utf-8 doesn't seem to be appended forapplication/javascript.https://github.com/GoogleCloudPlatform/gcloud-node/blob/d36802f03267a4c890a2f5203a8a46a452b329cf/lib/storage/bucket.js#L418
How about using https://github.com/jshttp/mime-types instead of https://github.com/broofa/node-mime?
node-mime doesn't seem to return any charset on application/javascript, but mime-types does.