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

remove redundunt check in static_file() #1300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SergBobrovsky
Copy link
Contributor

No description provided.

@@ -2883,7 +2883,7 @@ def static_file(filename, root,

if not filename.startswith(root):
return HTTPError(403, "Access denied.")
if not os.path.exists(filename) or not os.path.isfile(filename):
if not os.path.isfile(filename):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this is redundant.

In [71]: os.path.isfile("no-such-file")
Out[71]: False

@SergBobrovsky I believe that it will be easier for @defnull to review all your PRs if your commit messages are a bit more verbose.
Adding stuff like this in the commit message surely helps.

Copy link

@RonRothman RonRothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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