Skip to content

fix(form-file): issue with "accept" values (fixes #1526, reverts #2028) #2008

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

Merged
merged 3 commits into from
Oct 27, 2018
Merged

fix(form-file): issue with "accept" values (fixes #1526, reverts #2028) #2008

merged 3 commits into from
Oct 27, 2018

Conversation

impowski
Copy link
Contributor

@impowski impowski commented Aug 30, 2018

Fixes #1526

Reverts #2028

@codecov
Copy link

codecov bot commented Aug 30, 2018

Codecov Report

Merging #2008 into dev will increase coverage by 0.11%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2008      +/-   ##
==========================================
+ Coverage   64.61%   64.72%   +0.11%     
==========================================
  Files         154      154              
  Lines        2922     2917       -5     
  Branches      805      803       -2     
==========================================
  Hits         1888     1888              
+ Misses        744      741       -3     
+ Partials      290      288       -2
Impacted Files Coverage Δ
src/components/form-file/form-file.js 10.66% <0%> (+0.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 29b563a...dae59da. Read the comment docs.

@toadkicker
Copy link
Contributor

I propose we use the mime-types package and simplify this a lot for developers. It would be really nice to just say accepts="images", accepts="video", etc. and not worry about the specifics of all the mime types that means. We would also prevent a possible content spoofing attack because it can trust that the JS API is comparing the same symbols.

@impowski
Copy link
Contributor Author

impowski commented Sep 2, 2018

@toadkicker there is already images/* simple enough I guess. I see what you saying about spoofing I'll see how it can be done.

@tmorehouse tmorehouse changed the title fix(form-file): fixes #1526 fix(form-file): issue with "accept" values (fixes #1526) Oct 27, 2018
@tmorehouse
Copy link
Member

tmorehouse commented Oct 27, 2018

Basically, we should fall back to letting the browser handle the accept formats.

Older browsers had issues with which format to use (i.e. extension vs IANA media types).

Until we make a matching algorithm to test the file type (parsing the accept string into RegEx's and then testing against the file.type for IANA or file.name for extensions), we should just let the browser do the validation

@tmorehouse tmorehouse changed the title fix(form-file): issue with "accept" values (fixes #1526) fix(form-file): issue with "accept" values (fixes #1526, reverts #2028) Oct 27, 2018
@tmorehouse tmorehouse merged commit 963d478 into bootstrap-vue:dev Oct 27, 2018
@impowski impowski deleted the fix-file-accept branch October 29, 2018 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants