Make SharedDataMiddleware respect order of exports#1197
Closed
snoack wants to merge 0 commit intopallets:masterfrom
snoack:master
Closed
Make SharedDataMiddleware respect order of exports#1197snoack wants to merge 0 commit intopallets:masterfrom snoack:master
snoack wants to merge 0 commit intopallets:masterfrom
snoack:master
Conversation
Member
|
Would you rebase against master? We fixed the tests. |
Member
|
Wait, what happened? I rebased and pushed to your branch and it wiped all the changes and closed it. There's no option to reopen. |
Member
|
OK, sorry, I messed up and pushed the rebase without your changes, and GitHub won't let me push again because it thinks the pr is closed(?). I'll make a new PR with your commits. |
Member
|
Might be related to having the commits on master instead of a separate branch. |
This was referenced Dec 7, 2017
This was referenced Jan 5, 2018
This was referenced Jan 15, 2018
This was referenced Jan 29, 2018
This was referenced Feb 5, 2018
This was referenced Feb 13, 2018
This was referenced Feb 26, 2018
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The
SharedDataMiddleware(andserving.run_simple(static_files=...)respectively) takes a dict, mapping file and directory names in the URL to files, directories or modules on disk. However, there are no dict-lookups involved in that logic, but instead dict item's are iterated, until a first match is found. But since dict items are retrieved in arbitrary order, the behavior is unpredictable, in scenarios like this:If the key
/is yielded first, all requests resolve toindex.html. Even using anOrderedDictdoesn't help, since theSharedDataMiddlewareinternally creates anotherdict.It seems to make most sense to just use lists, both to be passed in when using the API, and for the internal data structure. However, for backwards compatibility I keep supporting dict-like objects as well, in this PR.