From cbb90a8de3bed03b68b6e537433c6e6d17ff52cb Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 18 Sep 2013 06:38:14 +0200 Subject: [PATCH] Fixed up URL quoting a bit. --- wrw/proto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wrw/proto.py b/wrw/proto.py index 8c8dcee..1af091f 100644 --- a/wrw/proto.py +++ b/wrw/proto.py @@ -102,10 +102,12 @@ def simpleerror(env, startreq, code, title, msg): return [buf] def urlq(url): + if isinstance(url, unicode): + url = url.encode("utf-8") ret = "" invalid = "&=#?/\"'" for c in url: - if c in invalid or (ord(c) <= 32): + if c in invalid or (ord(c) <= 32) or (ord(c) >= 128): ret += "%%%02X" % ord(c) else: ret += c -- 2.11.0