def _get_uri_from_request(request):
uri = request.base_url<EOL>if request.query_string:<EOL><INDENT>uri += '<STR_LIT:?>' + request.query_string.decode('<STR_LIT:utf-8>')<EOL><DEDENT>return uri<EOL>
The uri returned from request.uri is not properly urlencoded
(sometimes it's partially urldecoded) This is a weird hack to get
werkzeug to return the proper urlencoded string uri