You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a rate-limiting RPC middleware. Currently, jsonrpsee framework utilizes MethodResponse Extensions in the RPC layer and http::Response Extensions in the HTTP layer, with these extensions operating independently of each other.
I would like to propagate context information from the RPC layer to the HTTP layer to achieve functionality such as returning a status code other than 200 (429 in my case) or, at the very least, adding an HTTP header to indicate rate limiting based on data in contexts.
What would be the best approach to transfer context (Extensions) information from a jsonrpsee RPC middleware to a hyper HTTP middleware?
The text was updated successfully, but these errors were encountered:
shunsukew
changed the title
Pass context from RPC middleware to HTTP middleware
Pass response context from RPC middleware to HTTP middleware
Dec 27, 2024
shunsukew
changed the title
Pass response context from RPC middleware to HTTP middleware
Pass response contexts from RPC middleware to HTTP middleware
Dec 27, 2024
I think we could copy the extensions from the MethodResponse to the HTTP response to fix that and then you would need some HTTP middleware to check whether some error occurred and set desired HTTP status code on the response.
That would be really helpful. Thank you so much.
A single RPC call functions as expected, however, batch responses may require merging extension data. Addressing potential conflicts of the same Type data across calls within a batch is a subject for discussion.
I am developing a rate-limiting RPC middleware. Currently, jsonrpsee framework utilizes
MethodResponse
Extensions in the RPC layer andhttp::Response
Extensions in the HTTP layer, with these extensions operating independently of each other.I would like to propagate context information from the RPC layer to the HTTP layer to achieve functionality such as returning a status code other than 200 (429 in my case) or, at the very least, adding an HTTP header to indicate rate limiting based on data in contexts.
What would be the best approach to transfer context (Extensions) information from a jsonrpsee RPC middleware to a hyper HTTP middleware?
The text was updated successfully, but these errors were encountered: