{"action":"opened","issue":{"url":"https://api.github.com/repos/wagtail/wagtail/issues/4414","repository_url":"https://api.github.com/repos/wagtail/wagtail","labels_url":"https://api.github.com/repos/wagtail/wagtail/issues/4414/labels{/name}","comments_url":"https://api.github.com/repos/wagtail/wagtail/issues/4414/comments","events_url":"https://api.github.com/repos/wagtail/wagtail/issues/4414/events","html_url":"https://github.com/wagtail/wagtail/issues/4414","id":307457544,"number":4414,"title":"Redirects drop querystring parameters ","user":{"login":"MattSegal","id":12790824,"avatar_url":"https://avatars0.githubusercontent.com/u/12790824?v=4","gravatar_id":"","url":"https://api.github.com/users/MattSegal","html_url":"https://github.com/MattSegal","followers_url":"https://api.github.com/users/MattSegal/followers","following_url":"https://api.github.com/users/MattSegal/following{/other_user}","gists_url":"https://api.github.com/users/MattSegal/gists{/gist_id}","starred_url":"https://api.github.com/users/MattSegal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattSegal/subscriptions","organizations_url":"https://api.github.com/users/MattSegal/orgs","repos_url":"https://api.github.com/users/MattSegal/repos","events_url":"https://api.github.com/users/MattSegal/events{/privacy}","received_events_url":"https://api.github.com/users/MattSegal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-21T23:49:53Z","updated_at":"2018-03-21T23:49:53Z","closed_at":null,"author_association":"NONE","body":"### Issue Summary\r\n\r\nWagtail's RedirectMiddleware does not preserve querystring parameters. For example:\r\n\r\n```\r\nrequested url          www.example.com/old-path/?foo=1&bar=2\r\nexpected redirect      www.example.com/new-path/?foo=1&bar=2\r\nactual redirect        www.example.com/new-path/\r\n```\r\n\r\nI am experiencing this issue on v1.13.1, but by inspecting the code it seems that it persists in v2.\r\n\r\n### Steps to Reproduce\r\n\r\n- Create a `Redirect` instance from `old_path` to a `redirect_page` / `redirect_link` (eg `/old-path/` --> `/new-path/`\r\n- Browse to the old path, with query-string parameters (eg `/old-path/?foo=1&bar=2`)\r\n- Observe that you are redirected to `/new-path/` without the original querystring parameters.\r\n\r\n### Technical details\r\n\r\nI believe the issue is with `RedirectMiddleware.process_response`, where the response object is passed `redirect.link`, which does not include the querystring. It should be possible to use `request.META['QUERY_STRING']`, or similar, to pass on the querystring. \r\n\r\n* Python version: 3.5\r\n* Django version: 1.11.7\r\n* Wagtail version: 1.13.1.\r\n* Browser version: Chromium\r\n"}}
{"actor":{"display_login":"MattSegal"}}