From cc54c8d549cbe800ecc659c80d58a1fe729c78c9 Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@robocracy.org>
Date: Tue, 13 Jul 2021 16:41:08 -0700
Subject: web: fix flask/werkzeug encoding for mediawiki oauth

---
 python/fatcat_web/routes.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 1a573006..144922a8 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -1091,7 +1091,10 @@ def wp_oauth_rewrite():
     """
     This is a dirty hack to rewrite '/auth/wikipedia/auth' to '/auth/wikipedia/oauth-callback'
     """
-    return redirect(b"/auth/wikipedia/oauth-callback?" + request.query_string, 307)
+    return redirect(
+        (b"/auth/wikipedia/oauth-callback?" + request.query_string).decode('utf-8'),
+        307,
+    )
 
 @app.route('/auth/wikipedia/finish-login')
 def wp_oauth_finish_login():
-- 
cgit v1.2.3