Skip to content

refactor: use map_requests for handle_http_requests#156

Merged
fmoletta merged 3 commits into
mainfrom
refactor-handle_http_request
Jul 17, 2024
Merged

refactor: use map_requests for handle_http_requests#156
fmoletta merged 3 commits into
mainfrom
refactor-handle_http_request

Conversation

@fmoletta

Copy link
Copy Markdown
Contributor

Motivation

Currently, the handle_http_requests doesn't allow us to return an error when handling requests. This can be solved by handling them via a map_requests function like in handle_authrpc_requests. While handle_authrpc_requests handles comunication between clients and handle_http_requests handles comunication between the client and users, there are a lot of requests that are handled by both of them. As they both use the same request format, there is little reason to implement two different functions to handle the same requests in the same way. We can use map_requests to handle both auth_rpc and http requests, and then implement a second handler (such as map_internal_requests) to handle auth_prc-specific requests.

Description

Replaces handle_http_requests request handling with a call to map_requests

Closes None, but addresses comment on #145

@fmoletta fmoletta changed the title reafctor: Use map_requests for handle_http_requests reafctor: use map_requests for handle_http_requests Jul 17, 2024
@fmoletta fmoletta changed the title reafctor: use map_requests for handle_http_requests refactor: use map_requests for handle_http_requests Jul 17, 2024
@fmoletta fmoletta marked this pull request as ready for review July 17, 2024 14:39
@fmoletta fmoletta requested a review from a team as a code owner July 17, 2024 14:39
@mpaulucci

Copy link
Copy Markdown
Collaborator

👍 with the idea, I would add map_internal_requests in this PR.

@fmoletta fmoletta merged commit 822d8b6 into main Jul 17, 2024
@fmoletta fmoletta deleted the refactor-handle_http_request branch July 17, 2024 17:45
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.

2 participants