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

Options accept accepts more extensions than were desired #444

Open
drbsoftware opened this issue May 6, 2024 · 0 comments
Open

Options accept accepts more extensions than were desired #444

drbsoftware opened this issue May 6, 2024 · 0 comments

Comments

@drbsoftware
Copy link

There is a problem with the implementation specs in 3.2.1 To process accept types ... which results in difficulties when using the current Chrome and Edge browsers.

There are cases where multiple extensions use the same MIME types, such as image/jpeg, text/plain, text/html. With the current spec it is not possible to ask for only one of the extensions, This is because the spec is basically an OR of the MIME type and the extensions.
'text/plain': ['.txt'] will ask the Chrome or Edge user for .txt AND .text.

Currently the only workaround is to use a meaningless MIME type, for example:
'foo/bar': ['.txt']

Several backward-compatible solutions may be possible:

  • An operator setting on the options that would specify whether accept is an OR or an AND of the MIME type and the extensions.
  • An extensions array of permitted extensions in the type. If present and the O/S supports extensions, it would override the accept.
  • A mimes array of permitted mime types in the type. If present and and extensions were not, it too would override the accept.
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

No branches or pull requests

1 participant