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

Defaults content_type to application/octet-stream in blob_record.js #38124

Merged
merged 1 commit into from Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion activestorage/app/assets/javascripts/activestorage.js
Expand Up @@ -550,7 +550,7 @@
this.file = file;
this.attributes = {
filename: file.name,
content_type: file.type,
content_type: file.type || "application/octet-stream",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it makes sense to set null: false for content_type in the migration, since it should never be NULL and causes errors if it is NULL?

Copy link
Member

Choose a reason for hiding this comment

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

That sounds like a good idea. Would you like to make a PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done: #43055

byte_size: file.size,
checksum: checksum
};
Expand Down
2 changes: 1 addition & 1 deletion activestorage/app/javascript/activestorage/blob_record.js
Expand Up @@ -6,7 +6,7 @@ export class BlobRecord {

this.attributes = {
filename: file.name,
content_type: file.type,
content_type: file.type || "application/octet-stream",
byte_size: file.size,
checksum: checksum
}
Expand Down