#34726: Backslash replaced by forwardslash in queries
-------------------------------------+-------------------------------------
Reporter: Peskind | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 3.2
Uncategorized | Keywords: Backslash
Severity: Normal | urlpatterns
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
We use Django 3.2.3 with djangorestframework 3.14.0 (Windows 10)
In urls.py I've defined **urlpatterns**:
urlpatterns = [
path('items/<path:pk>', views.itemsPK, name='itemDetailsPK'),
...
]
and in** views.py** function:
@csrf_exempt
@api_view(['GET', 'POST', 'PUT', 'DELETE'])
@authentication_classes([BasicAuthentication, SessionAuthentication])
def itemsPK(request, pk): #(request, pk
"""
Retrieve, update or delete a code snippet.
"""
permission_classes = [permissions.IsAuthenticated]
logger = logging.getLogger('django')
logger.info( " :: foldimport:views:items :: "+ request.method+ "
request, pk="+str(pk))
...
If I send a query like ''http://127.0.0.1:8000/importvault/items/(STD-/
\000&87)'', backslash in pk will be replaced with forwardslash.
I've tried to use query parameters (pk = request.GET.get('itemNum', '')),
but it doesn't help.
Sending backslashes in the json body doesn't work as well.
How I can send parameters including backslashes? Forwardslash works
perfectly with <path:pk>.
--
Ticket URL: <https://code.djangoproject.com/ticket/34726>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/01070189739cbd6f-efee7d70-1c07-43a6-a949-3da4cac54102-000000%40eu-central-1.amazonses.com.