rails / marcel

Find the mime type of files, examining file, filename and declared type
Apache License 2.0
386 stars 67 forks source link

Update marcel to rack 3 #83

Closed hahmed closed 7 months ago

hahmed commented 1 year ago

Update marcel to rack 3.

The InputWrapper is no longer rewindable (https://github.com/rack/rack/blob/a7d56490fd2fb41de8c94ead2f63fbad71c5c489/lib/rack/lint.rb#L405), so i wrapped the input into a new rewindable object but maybe it might be better to simply read the content only and improve the current logic to take that into consideration.

I also added a bin/test file to make it easier to test a specific file or run bin/test for all tests.

jeremy commented 7 months ago

Rewindability is an upstream concern; can use the Rack::RewindableInput::Middleware in Rack 3.

Updated the tests to only cover the rewindable input wrapper in Rack 2: https://github.com/rails/marcel/commit/ccd4be5043628c4389230b4c012a7115b8e44c81