summaryrefslogtreecommitdiff
path: root/glanceclient/common/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'glanceclient/common/http.py')
-rw-r--r--glanceclient/common/http.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py
index a5fb153..9ba806f 100644
--- a/glanceclient/common/http.py
+++ b/glanceclient/common/http.py
@@ -66,7 +66,11 @@ def encode_headers(headers):
for h, v in headers.items():
if v is not None:
# if the item is token, do not quote '+' as well.
- safe = '=+/' if h in TOKEN_HEADERS else '/'
+ # NOTE(imacdonn): urlparse.quote() is intended for quoting the
+ # path part of a URL, but headers like x-image-meta-location
+ # include an entire URL. We should avoid encoding the colon in
+ # this case (bug #1788942)
+ safe = '=+/' if h in TOKEN_HEADERS else '/:'
if six.PY2:
# incoming items may be unicode, so get them into something
# the py2 version of urllib can handle before percent encoding