Replies: 1 comment
-
I agree with adding the feature, and your implementation approach sounds good. Please do submit a PR for it when you have time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a follow-up to an older discussion on the Rodauth google group. Currently, when using a Roda app as middleware, any response headers set in the
route
block are discarded if the request is forwarded to the main app. For Rodauth, this affects extending the remember period, and also possibleAuthorization
header updates when using JWT. In rodauth-rails, I had wrapped the middleware plugin in order to apply the changed response headers, but I consider it a bit of a hack, so I wanted to check if there is interest in an official implementation in the middleware plugin.I was imagining an additional boolean configuration option for the plugin, where the user can choose whether they want to enable this behaviour. I was thinking the response headers could be stored in Rack env (e.g.
roda.headers
) before throwing:next
in_roda_new_main_route
. Then after the main app is called (but before:handle_result
is called), the saved headers would be retrieved from env and merged into the headers of the main app's response. I was thinking of excluding Roda's default headers here, which I believe wouldn't be set onresponse.headers
anyway, as neither#finish
nor#finish_with_body
was called before a request is forwarded.If this sounds reasonable, I could work on a PR for that.
Beta Was this translation helpful? Give feedback.
All reactions