Bug 1495009 [wpt PR 13261] - Revert pipes change made in PR#13228, a=testonly
authorandypaicu <andypaicu@chromium.org>
Fri, 05 Oct 2018 14:20:58 +0000
changeset 440020 2978f836d767a5df733f210dd303a3af33f1c918
parent 440019 5cfce8016aea36a210a276cd8cad487c353244c7
child 440021 11e1636ba8c8b755caf68ae3da829680713ecb87
push id108725
push userwptsync@mozilla.com
push dateMon, 08 Oct 2018 16:48:05 +0000
treeherdermozilla-inbound@af3fd1f92628 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1495009, 13261, 13228
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1495009 [wpt PR 13261] - Revert pipes change made in PR#13228, a=testonly Automatic update from web-platform-testsRevert pipes change made in PR#13228 (#13261) -- wpt-commits: a56b0171854750ead65a32cb1cc0005a3fad1e11 wpt-pr: 13261
testing/web-platform/tests/tools/wptserve/wptserve/pipes.py
--- a/testing/web-platform/tests/tools/wptserve/wptserve/pipes.py
+++ b/testing/web-platform/tests/tools/wptserve/wptserve/pipes.py
@@ -466,34 +466,31 @@ def template(request, content, escape_ty
                      "pathname": request.url_parts.path,
                      "query": "?%s" % request.url_parts.query}
         elif field == "url_base":
             value = request.url_base
         else:
             raise Exception("Undefined template variable %s" % field)
 
         while tokens:
-            ttype, tfield = tokens.popleft()
+            ttype, field = tokens.popleft()
             if ttype == "index":
-                value = value[tfield]
+                value = value[field]
             elif ttype == "arguments":
-                value = value(request, *tfield)
+                value = value(request, *field)
             else:
                 raise Exception(
-                    "unexpected token type %s (token '%r'), expected ident or arguments" % (ttype, tfield)
+                    "unexpected token type %s (token '%r'), expected ident or arguments" % (ttype, field)
                 )
 
         assert isinstance(value, (int, (binary_type, text_type))), tokens
 
         if variable is not None:
             variables[variable] = value
 
-        if field == "GET" and not isinstance(value, str):
-            value = value.decode("utf-8")
-
         escape_func = {"html": lambda x:escape(x, quote=True),
                        "none": lambda x:x}[escape_type]
 
         #Should possibly support escaping for other contexts e.g. script
         #TODO: read the encoding of the response
         if isinstance(value, binary_type):
             value = value.decode("utf-8")
         elif isinstance(value, int):