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

Bring code borrowed from http.server in sync with upstream #4379

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Discookie
Copy link
Contributor

Remove translate_path() to rely on http.server's implementation, and fix handling of leading slashes.

@dkrupp dkrupp added this to the release 6.25.0 milestone Nov 5, 2024
Copy link
Collaborator

@cservakt cservakt left a comment

Choose a reason for hiding this comment

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

Can you get rid off the unused imports like posixpath and urllib to run pycodestyle test without any problem?


if self.path == '/':
self.path = "index.html"

# Check that the given path is a file.
# The base directory is set to www_root.
if not os.path.exists(self.translate_path(self.path)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

You already deleted this translate_path fuction so I think you would have modified this if state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted the re-implementation of the translate_path function, this calls SimpleHTTPRequestHandler.translate_path() - translating the path with the root set to www_root.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh OK, I didn't noticed that.

@Discookie
Copy link
Contributor Author

Linter passes as of latest commit.

@cservakt cservakt self-requested a review November 6, 2024 13:14
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