jazzband / django-silk

Silky smooth profiling for Django
MIT License
4.32k stars 332 forks source link

Curl and Django Test Client URL parameters are being url encoded #688

Closed erikcw closed 1 month ago

erikcw commented 7 months ago

Curl and Django Test Client URL parameters are being rendered in encoded form.

Example:

Curl:

curl -X GET   http://localhost:5000/px/?c=227cd4d894c7deb&rid=8bf881e6-93da-48c2-9c04-fbc55210708e&ccuid=a2696ad5-6610-4e1e-8e9f-c95174ea3c56

# EXPECTED

curl -X GET   http://localhost:5000/px/?c=227cd4d894c7deb&rid=8bf881e6-93da-48c2-9c04-fbc55210708e&ccuid=a2696ad5-6610-4e1e-8e9f-c95174ea3c560000

Django Test Client section:

from django.test import Client
c = Client()
response = c.get(path='/px/',
data={&  # x27;c': '227cd4d894c7deb', 'rid': '8bf881e6-93da-48c2-9c04-fbc55210708e', 'ccuid': 'a2696ad5-6610-4e1e-8e9f-c95174ea3c56'})

# EXPECTED:

response = c.get(path='/px/',
data={"c": "227cd4d894c7deb", "ccuid": "a2696ad5-6610-4e1e-8e9f-c95174ea3c56", "rid": "8bf881e6-93da-48c2-9c04-fbc55210708e"})

Here are the query parameters:

{
    "c": "227cd4d894c7deb",
    "ccuid": "a2696ad5-6610-4e1e-8e9f-c95174ea3c56",
    "rid": "8bf881e6-93da-48c2-9c04-fbc55210708e"
}