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

Check for current dir more explicitly #14

Merged
merged 1 commit into from
May 5, 2017
Merged

Conversation

xoseperez
Copy link

This is a nice-to-have.
Checking for current dir more explicitly will allow to add dot-starting files to the image. In the linux world these use to have settings and alike, so they can be used to store configuration in SPIFFS (like SPIFFS image version, for instance). The common webserver setup can then ignore these by

server.onNotFound([]() {

  // Hidden files
  if (server.uri().startsWith("/.")) {
    server.send(403, "text/plain", "Forbidden");
    return;
  }

  // Existing files in SPIFFS
  if (!handleFileRead(server.uri())) {
    server.send(404, "text/plain", "NotFound");
    return;
  }

});

@igrr igrr merged commit 4c41760 into igrr:master May 5, 2017
@me-no-dev
Copy link
Contributor

On Mac this often will upload .DS_Store. It's why the check was there. Maybe add exception for any such file found for next release?

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