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

fix(Server): validate express.static.mime.types #1765

Merged
merged 1 commit into from Apr 5, 2019

Conversation

hiroppy
Copy link
Member

@hiroppy hiroppy commented Apr 5, 2019

fixes: #1724

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Yes.

A test which Checks application/wasm already exists.

https://github.com/webpack/webpack-dev-server/blob/master/test/ContentBase.test.js#L301

Motivation / Use-Case

Validate express object.

Breaking Changes

no

Additional Info

no

lib/Server.js Outdated
express.static &&
express.static.mime &&
express.static.mime.types &&
!express.static.mime.types.wasm
Copy link
Member

Choose a reason for hiding this comment

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

I think better to remove !express.static.mime.types.wasm because in some old cases it can be text/html and it is invalid, we need use right mime for wasm

@codecov
Copy link

codecov bot commented Apr 5, 2019

Codecov Report

Merging #1765 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1765      +/-   ##
==========================================
+ Coverage    87.6%   87.62%   +0.02%     
==========================================
  Files           9        9              
  Lines         589      590       +1     
  Branches      175      176       +1     
==========================================
+ Hits          516      517       +1     
  Misses         61       61              
  Partials       12       12
Impacted Files Coverage Δ
lib/Server.js 83.33% <100%> (+0.04%) ⬆️

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 1b3cd4f...1cdb254. Read the comment docs.

@hiroppy
Copy link
Member Author

hiroppy commented Apr 5, 2019

@evilebottnawi PTAL 🙏

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Good job 👍

@alexander-akait
Copy link
Member

/cc @hiroppy something wrong with linting

@hiroppy
Copy link
Member Author

hiroppy commented Apr 5, 2019

Fixed.

@alexander-akait
Copy link
Member

God job!

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.

Cannot set property 'wasm' of undefined. Mismatched mime versions?
2 participants