Skip to content

🐛 Fixed uploads of m4a files with audio/mp4 content type#16342

Merged
daniellockyer merged 1 commit intoTryGhost:mainfrom
reupen:fix-firefox-m4a-uploads
Mar 1, 2023
Merged

🐛 Fixed uploads of m4a files with audio/mp4 content type#16342
daniellockyer merged 1 commit intoTryGhost:mainfrom
reupen:fix-firefox-m4a-uploads

Conversation

@reupen
Copy link
Contributor

@reupen reupen commented Feb 27, 2023

fixes #16301

Previously, audio/x-m4a was allowed but not audio/mp4. This meant uploads of m4a files failed in some cases e.g. Firefox on Windows (as per the linked issue).

  • There's a clear use-case for this code change, explained below
  • Commit message has a short title & references relevant issues
  • The build will pass (run yarn test:all and yarn lint)

fixes TryGhost#16301

Previously, audio/x-m4a was allowed but not audio/mp4. This meant
uploads of m4a files failed in some cases e.g. Firefox on Windows.
@reupen reupen force-pushed the fix-firefox-m4a-uploads branch from 5f1bc69 to e6dc32d Compare February 27, 2023 20:28
.set('Origin', config.get('url'))
.expect('Content-Type', /json/)
.field('ref', 'audio_file_mp4')
.attach('file', path.join(__dirname, '/../../utils/fixtures/media/sample.m4a'), {filename: 'audio-mp4.m4a', contentType: 'audio/mp4'})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

audio/mp4 is actually the default here, but I made sure that both content types are explicitly covered.

@reupen reupen marked this pull request as ready for review February 27, 2023 20:37
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01 🎉

Comparison is base (f007094) 72.37% compared to head (e6dc32d) 72.39%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16342      +/-   ##
==========================================
+ Coverage   72.37%   72.39%   +0.01%     
==========================================
  Files        1789     1789              
  Lines      114022   114010      -12     
  Branches    17187    17184       -3     
==========================================
+ Hits        82529    82540      +11     
+ Misses      30176    30152      -24     
- Partials     1317     1318       +1     
Flag Coverage Δ
e2e-tests 85.31% <ø> (-0.03%) ⬇️
unit-tests 56.22% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...tor/lib/tables/members-paid-subscription-events.js 90.24% <0.00%> (-9.76%) ⬇️
ghost/data-generator/lib/tables/members.js 90.42% <0.00%> (-7.45%) ⬇️
ghost/core/core/app.js 80.00% <0.00%> (-2.50%) ⬇️
ghost/admin/app/components/gh-dropdown.js 89.79% <0.00%> (-2.05%) ⬇️
ghost/data-generator/lib/tables/mentions.js 98.41% <0.00%> (-1.59%) ⬇️
ghost/data-generator/lib/tables/emails.js 93.47% <0.00%> (-1.09%) ⬇️
ghost/core/core/server/services/stripe/config.js 97.18% <0.00%> (-0.16%) ⬇️
ghost/core/core/shared/labs.js 95.16% <0.00%> (-0.04%) ⬇️
ghost/stripe/lib/StripeService.js 0.00% <0.00%> (ø)
ghost/admin/app/services/feature.js 81.35% <0.00%> (ø)
... and 18 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@daniellockyer daniellockyer merged commit c5a4ee8 into TryGhost:main Mar 1, 2023
@daniellockyer
Copy link
Contributor

Thanks @reupen 🎉 This will be shipped in the next Ghost release 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uploading an m4a file to an audio card fails when using Firefox on Windows

2 participants