From 5106c7822cbda3b0b9d14f12d2b6af733e18deb0 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 6 Nov 2015 13:35:33 +0100 Subject: [PATCH] Remove path_info from request message format --- channels/request.py | 4 ++-- docs/message-standards.rst | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/channels/request.py b/channels/request.py index 0d34c37..2af4098 100644 --- a/channels/request.py +++ b/channels/request.py @@ -15,7 +15,6 @@ def encode_request(request): "cookies": request.COOKIES, "meta": {k: v for k, v in request.META.items() if not k.startswith("wsgi")}, "path": request.path, - "path_info": request.path_info, "method": request.method, "reply_channel": request.reply_channel, } @@ -33,8 +32,9 @@ def decode_request(value): request.META = value['meta'] request.path = value['path'] request.method = value['method'] - request.path_info = value['path_info'] request.reply_channel = value['reply_channel'] + # We don't support non-/ script roots + request.path_info = value['path'] return request diff --git a/docs/message-standards.rst b/docs/message-standards.rst index 8924048..ae5d75b 100644 --- a/docs/message-standards.rst +++ b/docs/message-standards.rst @@ -38,7 +38,6 @@ Contains the following keys: * cookies: Dict of cookies as {cookie_name: cookie_value} (names and values are strings) * meta: Dict of HTTP headers and info as defined in the Django Request docs (names and values are strings) * path: String, full path to the requested page, without query string or domain -* path_info: String, like ``path`` but without any script prefix. Often just ``path``. * method: String, upper-cased HTTP method Should come with an associated ``reply_channel`` which accepts HTTP Responses.