Skip to content

Do not include the query string in PATH_INFO when recalling the original controller#5850

Open
augustocbx wants to merge 1 commit into
heartcombo:mainfrom
augustocbx:fix-failure-app-path-info-query-params
Open

Do not include the query string in PATH_INFO when recalling the original controller#5850
augustocbx wants to merge 1 commit into
heartcombo:mainfrom
augustocbx:fix-failure-app-path-info-query-params

Conversation

@augustocbx

Copy link
Copy Markdown
Contributor

Warden sets attempted_path to the request's fullpath, including the query string, and the failure app was writing that value verbatim into PATH_INFO when recalling the original controller. Per the Rack SPEC, PATH_INFO must not contain a query string, and this mismatch causes valid authenticity tokens to be rejected on recall, since Rails takes the path into account when validating them.

This strips the query string before mutating PATH_INFO; the query remains available to the recalled action through QUERY_STRING.

Fixes #5704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Failure App incorrectly adds url query parameters to PATH_INFO

1 participant