Skip to content

Why using binary for 'application/javascript' and alike? #131

@Vadorequest

Description

@Vadorequest

I don't understand why you use a binary mime type for

const binaryMimeTypes = [
  'application/javascript',
  'application/json',
  'application/octet-stream',
  'application/xml',
  'font/eot',
  'font/opentype',
  'font/otf',
  'image/jpeg',
  'image/png',
  'image/svg+xml',
  'text/comma-separated-values',
  'text/css',
  'text/html',
  'text/javascript',
  'text/plain',
  'text/text',
  'text/xml'
];

I think it makes sense for image/* (because png/jpg are treated as binary format by API Gateway and won't be displayed without this) but I don't get why you use it on application/json or application/javascript at all, and I don't know what repercussions this may have on the behaviour of an application.

Could you explain the reason behind this? I would guess something like the following would be enough.

const binaryMimeTypes = [
  'application/octet-stream',
  'image/jpeg',
  'image/png',
  'text/comma-separated-values // unsure if that's binary format
];

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions