#36488: RedirectView(query_string=True) produces double '?' when both destination
URL and request have query parameters
------------------------------+-----------------------------------------
Reporter: Ethan Jucovy | Type: Bug
Status: new | Component: Generic views
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+-----------------------------------------
When using the generic `RedirectView(query_string=True)` with a query
string in the destination URL, the view always appends query string
parameters from the incoming request with a `?` separator. It should use
`&` if there's also an existing query string in the incoming URL.
Currently, requests that come in with a query string end up redirected to
a URL containing two question marks, e.g.:
{{{
path("redirect-me/", RedirectView.as_view(url="/destination/?pork=spam",
query_string=True))
}}}
{{{
GET /redirect-me/?utm_source=foo
}}}
Currently results in:
{{{
Location: /destination/?pork=spam?utm_source=foo
}}}
Expected:
{{{
Location: /destination/?pork=spam&utm_source=foo
}}}
--
Ticket URL: <
https://code.djangoproject.com/ticket/36488>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.