Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/improve file extensions #150

Merged
merged 2 commits into from
Mar 20, 2020
Merged

Conversation

renefloor
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Improve parsing of MIME content-type.

⤵️ What is the current behavior?

Currently it just takes the subtype of the content-type as fileExtension. This works fine for types as image/png, but fails to differentiate between video/mpeg and video/mpeg. Content-types as application/vnd.openxmlformats-officedocument.presentationml.presentation just get really weird extensions.

🆕 What is the new behavior (if this is a feature change)?

It checks the most common content types from mozilla and parses them. If it is not in the list it falls back on previous behaviour.

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

The current tests are still successful.

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated
  • Rebased onto current develop

@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #150 into develop will increase coverage by 0.2%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop     #150     +/-   ##
==========================================
+ Coverage     38.3%   38.51%   +0.2%     
==========================================
  Files            7        8      +1     
  Lines          295      296      +1     
==========================================
+ Hits           113      114      +1     
  Misses         182      182
Impacted Files Coverage Δ
lib/src/web/web_helper.dart 0% <ø> (ø)
lib/src/cache_manager.dart 0% <ø> (ø) ⬆️
lib/src/web/file_fetcher.dart 87.87% <100%> (ø)
lib/src/web/mime_converter.dart 66.66% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa33b15...3fd1b7c. Read the comment docs.

@renefloor renefloor merged commit fe68847 into develop Mar 20, 2020
@renefloor renefloor deleted the feature/improve-file-extensions branch March 20, 2020 16:27
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.

1 participant