-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow StaticFiles follow symlinks #1683
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
Changes from 1 commit
4c6c59e
a799da7
b396b1b
db5cd57
ac7d928
ebc4f4d
140edb6
5a3c109
34fe083
7a8d49c
c404cb6
e3e85db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,7 +161,7 @@ def lookup_path( | |
| self, path: str | ||
| ) -> typing.Tuple[str, typing.Optional[os.stat_result]]: | ||
| for directory in self.all_directories: | ||
| full_path = os.path.realpath(os.path.join(directory, path)) | ||
| full_path = os.path.abspath(os.path.join(directory, path)) | ||
| directory = os.path.realpath(directory) | ||
| if os.path.commonprefix([full_path, directory]) != directory: | ||
| # Don't allow misbehaving clients to break out of the static files | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I understand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not change line 165
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a test with the scenario @scientificRat mentioned?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, I'll take a look.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if I got the point correctly, but I added the tests for this, but I think this change is not needed. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.