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

fix: using python http server #1406

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

Conversation

thegrannychaseroperation
Copy link
Contributor

When submitting this pull request, I confirm the following (please check the boxes):

  • I have read and understood the Contributor Guidelines.
  • I have checked that there are no duplicate pull requests related to this request.
  • I have considered, and confirm that this submission is valuable to others.
  • I accept that this submission may not be used and the pull request may be closed at the discretion of the maintainers.

Fill in the PR content:

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Replaced Flask web framework with Python's built-in http.server module for handling RPC requests, simplifying dependencies while maintaining core functionality.

  • Removed Flask dependency from requirements.txt, reducing external dependencies
  • Implemented custom RequestHandler class in python_rpc/main.py with manual HTTP response handling
  • Added password validation through validate_rpc_password() method for all endpoints
  • Maintained consistent JSON response format for download status, seeding, and process list endpoints
  • Added error handling for torrent and HTTP download initialization in startup code

💡 (5/5) You can turn off certain types of comments like style here!

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -4,5 +4,4 @@ cx_Logging; sys_platform == 'win32'
pywin32; sys_platform == 'win32'
psutil
Pillow
flask
aria2p
Copy link

Choose a reason for hiding this comment

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

style: aria2p dependency may no longer be needed since HTTP downloads are now handled by the built-in http.server module

Comment on lines +64 to +65
if not self.validate_rpc_password():
return
Copy link

Choose a reason for hiding this comment

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

logic: early return without response body could cause client issues - should send 401 response like other endpoints

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.

1 participant