-
Notifications
You must be signed in to change notification settings - Fork 3k
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
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
There was a problem hiding this 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 inpython_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 |
There was a problem hiding this comment.
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
if not self.validate_rpc_password(): | ||
return |
There was a problem hiding this comment.
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
When submitting this pull request, I confirm the following (please check the boxes):
Fill in the PR content: