Skip to content

Add SVG as file type and default to binary stream for static handler #952

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 1 commit into from
Nov 2, 2015

Conversation

KaloNK
Copy link
Contributor

@KaloNK KaloNK commented Nov 1, 2015

No description provided.

igrr added a commit that referenced this pull request Nov 2, 2015
Add SVG as file type and default to binary stream for static handler
@igrr igrr merged commit 7e8bcca into esp8266:master Nov 2, 2015
@grahamehorner
Copy link

would in not be better to have this changed to determine from a array of key value pairs; rather than a list of if statements; the key value pairs could also be populated via user code or an external data (json) file. I feel that the hardcoding of file extensions/meta types isn't in code isn't good.

@igrr
Copy link
Member

igrr commented Nov 2, 2015

@grahamehorner If you want to customize this list, you can basically write your own version of StaticRequestHandler and pass it to ESP8266WebServer::addHandler method.

@grahamehorner
Copy link

@igrr I can foresee a lot of custom StaticRequestHandler implementions not everyone will need or want these items in the list; it would be better to have perhaps to create a callback which implements the getContentType and have the ability to replace the default with developer code?

@igrr
Copy link
Member

igrr commented Nov 2, 2015

Yes it's possible to add such a callback as an optional argument to ESP8266WebServer::serveStatic method.

@grahamehorner
Copy link

@igrr ok, missed that one

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.

3 participants