- Notifications
You must be signed in to change notification settings - Fork13.3k
Improve LittleFS support#7071
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Previously, when the path was a directory, but didn't have a slash atthe end, a 0 byte response would be sent when using LittleFS. Now, itwill return a 404, like was always the case when using SPIFFS.
devyte approved these changesFeb 22, 2020
earlephilhower approved these changesFeb 23, 2020
Collaborator
earlephilhower left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM.. Thanks.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
A bit of a follow-up to#6987. The subject matters is once again LittleFS support for
ESP8266WebServer.serveStatic()and the cause of problematic behavior is once again that you can create aFilefor a directory in LittleFS, but can't in SPIFFS.When the path was a directory, but didn't have a slash at the end, a 0 byte response would be sent if using LittleFS. This pull request fixes this weird behavior and now it will return a 404 instead.
<aside>
The reason for returning a 404 is that this is the behavior you get when using SPIFFS. However, that's probably because it's quite hard to detect that situation on SPIFFS. On LittleFS, it's simple (we're basically already doing it with this change), so there is a case to be made to return a 301 to
path + "/"(as is the default behavior of both apache and nginx). It means different behavior between SPIFFS and LittleFS, but the best behavior that can be supported for both.If you guys agree that this is the way to go, I might actually pick this up.
</aside>