#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070197c1ee67a3-5af8ee16-e585-4b37-b817-379f5d2dcad0-000000%40eu-central-1.amazonses.com.