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

Requesting a static file with an extension crow doens't know about causes an uncaught exception #410

Closed
danielskeenan opened this issue Apr 16, 2022 · 2 comments · Fixed by #411
Labels
bug Something isn't working good first issue an issue suitable to start contributing to the project
Milestone

Comments

@danielskeenan
Copy link
Contributor

Asking crow to respond to a static file request using crow::response::set_static_file_info causes an uncaught std::out_of_range exception if the file's extension is not one crow knows about (i.e. not in crow::mime_types).

@The-EDev The-EDev added the bug Something isn't working label Apr 16, 2022
@The-EDev
Copy link
Member

I'm guessing this is for files without a . in their names (since that's how Crow determines the extension). The best fix would be to add an extension / mime-type argument to the method, while also adding an if statement before here.

@The-EDev The-EDev added the good first issue an issue suitable to start contributing to the project label Apr 16, 2022
@danielskeenan
Copy link
Contributor Author

This actually came up when Android Chrome requested site.webmanifest. Working on a PR now to handle the std::out_of_range when setting the mime type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue an issue suitable to start contributing to the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants