Fix exception in WPT service-workers/cache-storage/resources/vary.py

This exception is unlikely to be the cause of the leak in bug 1596251, but I
came across it while investigating.

Differential Revision: https://phabricator.services.mozilla.com/D53358

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1596251
gecko-commit: 82ba763a36a7940c8980a2f7262a97defb074399
gecko-integration-branch: autoland
gecko-reviewers: jgraham
diff --git a/service-workers/cache-storage/resources/vary.py b/service-workers/cache-storage/resources/vary.py
index 59e39bc..a609d7e 100644
--- a/service-workers/cache-storage/resources/vary.py
+++ b/service-workers/cache-storage/resources/vary.py
@@ -1,3 +1,5 @@
+from six import text_type
+
 def main(request, response):
   if "clear-vary-value-override-cookie" in request.GET:
     response.unset_cookie("vary-value-override")
@@ -15,7 +17,7 @@
   # (including query), but differ by VARY header.
   cookie_vary = request.cookies.get("vary-value-override");
   if cookie_vary:
-    response.headers.set("vary", cookie_vary)
+    response.headers.set("vary", text_type(cookie_vary))
   else:
     # If there is no cookie, then use the query string value, if present.
     query_vary = request.GET.first("vary", default="")