[arch-commits] Commit in httpbin/trunk (3 files)
Chih-Hsuan Yen
yan12125 at gemini.archlinux.org
Fri Apr 15 02:07:16 UTC 2022
Date: Friday, April 15, 2022 @ 02:07:15
Author: yan12125
Revision: 1186428
upgpkg: httpbin 0.7.0-9; compatibility with python-werkzeug >= 2.1.0
Keeping compatibility with older werkzeug can be quite complicated, so I
decided to only consider the latest werkzeug and use the simplest patch.
The patch httpbin-werkzeug-2.0.0.patch is no longer needed, as it fixes
the same issue as httpbin-werkzeug-2.1.0.patch:
`autocorrect_location_header` not set on the correct class.
Fixes https://bugs.archlinux.org/task/74443
See: https://github.com/postmanlabs/httpbin/pull/674
Added:
httpbin/trunk/httpbin-werkzeug-2.1.0.patch
Modified:
httpbin/trunk/PKGBUILD
Deleted:
httpbin/trunk/httpbin-werkzeug-2.0.0.patch
------------------------------+
PKGBUILD | 10 ++++++----
httpbin-werkzeug-2.0.0.patch | 32 --------------------------------
httpbin-werkzeug-2.1.0.patch | 32 ++++++++++++++++++++++++++++++++
3 files changed, 38 insertions(+), 36 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-04-15 01:24:40 UTC (rev 1186427)
+++ PKGBUILD 2022-04-15 02:07:15 UTC (rev 1186428)
@@ -2,7 +2,7 @@
pkgname=httpbin
pkgver=0.7.0
-pkgrel=8
+pkgrel=9
pkgdesc="HTTP Request and Response Service"
arch=('any')
url="https://github.com/requests/httpbin"
@@ -13,15 +13,17 @@
makedepends=('python-setuptools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/requests/httpbin/archive/v$pkgver.tar.gz"
httpbin-werkzeug-0.15.1.patch
- httpbin-werkzeug-2.0.0.patch)
+ httpbin-werkzeug-2.1.0.patch)
sha512sums=('faec48a0a2ac8800293b10281966a28195884ad2f69f0f28f1b8c8e1a7bfd8933ebbc9b541c80cdc19e1031a8ba9383afe8e372b9044436cb307dd1e8eddaae7'
'3c058ca5f685e281f7d60216de844e58727e7677766660df410ec57d8c985485cf611ec64eb71a234bdd49b4fdf66be6138d4bb7258d9e6d0346d6c6ee9f3cdf'
- '25aced8dc34ed517ba7304d86d7e32fc49282262512962edf743265c78f3c5a2e3324902ec76ea121c11a9af0219d8c4e506ce301ad625d9e72f07491b8cbe49')
+ '3d9ed7ab76dc0a33d69cf973e16be7358daa0af0a48d5ac24e0ad6ea8d73a68a796b4c8526ad764c0ed09997448f744f205b909261c32405ff166b359be1fb8b')
prepare() {
cd httpbin-$pkgver
patch -p1 -i ../httpbin-werkzeug-0.15.1.patch
- patch -p1 -i ../httpbin-werkzeug-2.0.0.patch
+ # patch taken from https://github.com/maximino-dev/httpbin/commit/5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b,
+ # which is the first version of https://github.com/postmanlabs/httpbin/pull/674
+ patch -p1 -i ../httpbin-werkzeug-2.1.0.patch
sed -i 's/brotlipy/Brotli/g' setup.py
}
Deleted: httpbin-werkzeug-2.0.0.patch
===================================================================
--- httpbin-werkzeug-2.0.0.patch 2022-04-15 01:24:40 UTC (rev 1186427)
+++ httpbin-werkzeug-2.0.0.patch 2022-04-15 02:07:15 UTC (rev 1186428)
@@ -1,32 +0,0 @@
-From ccd417eea8d13192ea980539e1a4bbe31206c802 Mon Sep 17 00:00:00 2001
-From: Adam Williamson <awilliam at redhat.com>
-Date: Mon, 19 Jul 2021 15:41:23 -0700
-Subject: [PATCH] Fix disabling of location header autocorrect for werkzeug 2+
- (#647)
-
-In werkzeug 2.0.0 and later, the Location header autocorrection
-moved from BaseResponse to Response, so we need to set
-`autocorrect_location_header = False` in `Response` not
-`BaseResponse`. For now let's just set it in both to be safe,
-this doesn't cause any errors at least with 1.0.1 and 2.0.1.
-
-Signed-off-by: Adam Williamson <awilliam at redhat.com>
----
- httpbin/core.py | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/httpbin/core.py b/httpbin/core.py
-index 305c9882..3726e21f 100644
---- a/httpbin/core.py
-+++ b/httpbin/core.py
-@@ -77,7 +77,10 @@ def jsonify(*args, **kwargs):
-
-
- # Prevent WSGI from correcting the casing of the Location header
-+# and forcing it to be absolute. This moved from BaseResponse to
-+# Response in werkzeug 2.0.0, so we set both to be safe.
- BaseResponse.autocorrect_location_header = False
-+Response.autocorrect_location_header = False
-
- # Find the correct template folder when running from a different location
- tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates")
Added: httpbin-werkzeug-2.1.0.patch
===================================================================
--- httpbin-werkzeug-2.1.0.patch (rev 0)
+++ httpbin-werkzeug-2.1.0.patch 2022-04-15 02:07:15 UTC (rev 1186428)
@@ -0,0 +1,32 @@
+From 5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b Mon Sep 17 00:00:00 2001
+From: Maximino BOGADO <bogamax2 at hotmail.fr>
+Date: Wed, 30 Mar 2022 16:26:31 +0200
+Subject: [PATCH] Replace BaseResponse to Response class (new werkzeug version
+ 2.1.0)
+
+---
+ httpbin/core.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/httpbin/core.py b/httpbin/core.py
+index 305c9882..2bad408e 100644
+--- a/httpbin/core.py
++++ b/httpbin/core.py
+@@ -29,7 +29,7 @@
+ from six.moves import range as xrange
+ from werkzeug.datastructures import WWWAuthenticate, MultiDict
+ from werkzeug.http import http_date
+-from werkzeug.wrappers import BaseResponse
++from werkzeug.wrappers import Response
+ from werkzeug.http import parse_authorization_header
+ from flasgger import Swagger, NO_SANITIZER
+
+@@ -77,7 +77,7 @@ def jsonify(*args, **kwargs):
+
+
+ # Prevent WSGI from correcting the casing of the Location header
+-BaseResponse.autocorrect_location_header = False
++Response.autocorrect_location_header = False
+
+ # Find the correct template folder when running from a different location
+ tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates")
More information about the arch-commits
mailing list