#34726 closed Uncategorized (invalid)

Backslash replaced by forwardslash in queries

Reported by: Dmitry Peskin Owned by: nobody
Component: Uncategorized Version: 3.2
Severity: Normal Keywords: Backslash urlpatterns
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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>.

Change History (1)

comment:1 by Natalia Bidart, 10 months ago

Resolution: invalid
Status: newclosed

Hello,

This ticket seems to be a support request. The best place to get answers to your issue is using any of the user support channels from this link.

Since the goal of this issue tracker is to track issues about Django itself, and not to track support requests, I'll be closing this ticket as invalid.

Note: See TracTickets for help on using tickets.
Back to Top