igrr / mkspiffs

Tool to build and unpack SPIFFS images
MIT License
193 stars 92 forks source link

Check for current dir more explicitly #14

Closed xoseperez closed 7 years ago

xoseperez commented 8 years ago

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;
  }

});
me-no-dev commented 7 years ago

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?