Skip to content

Changes to static request handler #1007

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 2 commits into from
Nov 13, 2015
Merged

Changes to static request handler #1007

merged 2 commits into from
Nov 13, 2015

Conversation

sticilface
Copy link
Contributor

Try number two:

As discussed in #999

Allow serving of static SPIFFS files with a cache-control header. Defaults to nothing, so existing sketches are not broken. Takes a const char * but is stored as string.

Also added the ability to serve gz files, and directories. The handler will serve the original file first if present, then the gzipped one. Directories can also be served statically with the same rules.

Examples

// serves all SPIFFS with 24hr max-age control
HTTP.serveStatic("", SPIFFS, "","max-age=86400"); 
// serves all of server directory with no-cache
HTTP.serveStatic("/server", SPIFFS, "/server", "no-cache"); 

igrr added a commit that referenced this pull request Nov 13, 2015
Changes to static request handler
@igrr igrr merged commit a6cb40f into esp8266:master Nov 13, 2015
@sticilface sticilface deleted the master branch November 13, 2015 13:37
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.

2 participants