Problem/Motivation

gzip is a popular file format and a software application used for file compression and decompression. Working with file entity and media module, this small support can give the site builders more choices for the documents.

Ref: https://tools.ietf.org/html/rfc6713

Proposed resolution

Add gzip to default MIME extension mapping list

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

@todo

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Joseph Zhao created an issue. See original summary.

pandaski’s picture

Status: Active » Needs review
FileSize
860 bytes
dww’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. I agree that .gz is a commonly used file type that core should be able to guess the mime type of, and we already handle .tgz files in this class.

There seems to be 0 test coverage of this class in core, so it seems out of scope to be requiring a test for this issue. If we want to test this class, we need to test a lot more than .gz. ;) The only test that comes close is core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php but that's not testing the MimeTypeGuesser and its guesses, it's only testing that we properly register it with Symfony. See MimeTypeGuesserTest::testSymfonyGuesserRegistration(). So, I can't in good conscience set this NW and tag "needs tests".

Given that, there's nothing wrong with this patch.

RTBC.

Thanks,
-Derek

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 3032852-2.patch, failed testing. View results

dww’s picture

Status: Needs work » Reviewed & tested by the community

Confused bot. Requeued #2. Back to RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 3032852-2.patch, failed testing. View results

dww’s picture

Status: Needs work » Needs review
FileSize
860 bytes

Sad confused bot. :/ Trying to re-upload #2 to see if this helps.

pandaski’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: 3032852-2-again.patch, failed testing. View results

dww’s picture

Status: Needs work » Reviewed & tested by the community

Silly bot. Re-queued...

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: 3032852-2-again.patch, failed testing. View results

Krzysztof Domański’s picture

Status: Needs work » Reviewed & tested by the community

Re-queued. Back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2020819 and pushed to 8.7.x. Thanks!

  • alexpott committed 2020819 on 8.7.x
    Issue #3032852 by Joseph Zhao, dww: Add gzip to default MIME extension...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.