Skip to content

application/javascript is deprecated. text/javascript should be used for js files #109

Open
@MrRTi

Description

@MrRTi

I had some issues with carrierwave content type checks and it resulted in founding out the usage of deprecated mime type by marcel

Ref about deprecation - https://www.rfc-editor.org/rfc/rfc9239.html#name-text-javascript

Deprecated alias names for this type: application/javascript ...

Current behaviour:

Marcel::Magic.by_path("tmp/data.js").try(:type) # => "application/javascript"

Expected behaviour:

Marcel::Magic.by_path("tmp/data.js").try(:type) # => "text/javascript"

When I checked the code I find that mime-types for javascript at

<mime-type type="application/javascript">

have different order as in
https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
used at https://github.com/rails/marcel/blob/main/script/download_tika_data.rb

I suppose that could be a core of the problem.

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