summaryrefslogtreecommitdiff
path: root/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch')
-rw-r--r--dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch24
1 files changed, 1 insertions, 23 deletions
diff --git a/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch b/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch
index c3d87ec4144d..d4695173dad5 100644
--- a/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch
+++ b/dev-python/httpbin/files/httpbin-0.10.1-optional-flasgger.patch
@@ -54,34 +54,12 @@ index a82c1b8..77576a4 100644
+ @app.route("/")
+ def no_flasgger_index():
+ """Redirect to legacy index if flasgger is not available."""
-+ return redirect(url_for("view_landing_page"))
++ return view_landing_page()
+
+
@app.route("/legacy")
def view_landing_page():
"""Generates Landing Page in legacy layout."""
-diff --git a/tests/test_httpbin.py b/tests/test_httpbin.py
-index 6b75124..2ce63a6 100755
---- a/tests/test_httpbin.py
-+++ b/tests/test_httpbin.py
-@@ -10,6 +10,7 @@ from hashlib import md5, sha256, sha512
- from io import BytesIO
-
- import httpbin
-+from httpbin.core import Swagger
- from httpbin.helpers import parse_multi_value_header
-
-
-@@ -115,7 +116,8 @@ class HttpbinTestCase(unittest.TestCase):
-
- def test_index(self):
- response = self.app.get('/', headers={'User-Agent': 'test'})
-- self.assertEqual(response.status_code, 200)
-+ self.assertEqual(response.status_code,
-+ 200 if Swagger is not None else 302)
-
- def get_data(self, response):
- if 'get_data' in dir(response):
--
2.43.0