amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.57k stars 204 forks source link

Fix Static pipe test on newer systems that uses "text/javascript" mime type. #1342

Closed hugopl closed 8 months ago

hugopl commented 8 months ago
Failures:

  1) Amber::Pipe::Static serves the correct content type for serve file
     Failure/Error: response.headers["content-type"].should eq(Amber::Support::MimeTypes.mime_type(ext))

       Expected: "application/javascript"
            got: "text/javascript"

     # spec/amber/pipes/static_spec.cr:44

According to https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/ "application/javascript" is obsolete.

Possible Drawbacks

This may fail on CI if the system used to test is too old.