Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 0a8bb0d

Browse files
author
yan12125
committed
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: postmanlabs/httpbin#674 git-svn-id: file:///srv/repos/svn-community/svn@1186428 9fca08f4-af9d-4005-b8df-a31f2cc04f65
1 parent 9b3865e commit 0a8bb0d

File tree

3 files changed

+38
-36
lines changed

3 files changed

+38
-36
lines changed

httpbin/trunk/PKGBUILD

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pkgname=httpbin
44
pkgver=0.7.0
5-
pkgrel=8
5+
pkgrel=9
66
pkgdesc="HTTP Request and Response Service"
77
arch=('any')
88
url="https://github.com/requests/httpbin"
@@ -13,15 +13,17 @@ depends=('python-flask' 'python-markupsafe' 'python-itsdangerous' 'python-six' '
1313
makedepends=('python-setuptools')
1414
source=("$pkgname-$pkgver.tar.gz::https://github.com/requests/httpbin/archive/v$pkgver.tar.gz"
1515
httpbin-werkzeug-0.15.1.patch
16-
httpbin-werkzeug-2.0.0.patch)
16+
httpbin-werkzeug-2.1.0.patch)
1717
sha512sums=('faec48a0a2ac8800293b10281966a28195884ad2f69f0f28f1b8c8e1a7bfd8933ebbc9b541c80cdc19e1031a8ba9383afe8e372b9044436cb307dd1e8eddaae7'
1818
'3c058ca5f685e281f7d60216de844e58727e7677766660df410ec57d8c985485cf611ec64eb71a234bdd49b4fdf66be6138d4bb7258d9e6d0346d6c6ee9f3cdf'
19-
'25aced8dc34ed517ba7304d86d7e32fc49282262512962edf743265c78f3c5a2e3324902ec76ea121c11a9af0219d8c4e506ce301ad625d9e72f07491b8cbe49')
19+
'3d9ed7ab76dc0a33d69cf973e16be7358daa0af0a48d5ac24e0ad6ea8d73a68a796b4c8526ad764c0ed09997448f744f205b909261c32405ff166b359be1fb8b')
2020

2121
prepare() {
2222
cd httpbin-$pkgver
2323
patch -p1 -i ../httpbin-werkzeug-0.15.1.patch
24-
patch -p1 -i ../httpbin-werkzeug-2.0.0.patch
24+
# patch taken from https://github.com/maximino-dev/httpbin/commit/5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b,
25+
# which is the first version of https://github.com/postmanlabs/httpbin/pull/674
26+
patch -p1 -i ../httpbin-werkzeug-2.1.0.patch
2527
sed -i 's/brotlipy/Brotli/g' setup.py
2628
}
2729

httpbin/trunk/httpbin-werkzeug-2.0.0.patch

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b Mon Sep 17 00:00:00 2001
2+
From: Maximino BOGADO <[email protected]>
3+
Date: Wed, 30 Mar 2022 16:26:31 +0200
4+
Subject: [PATCH] Replace BaseResponse to Response class (new werkzeug version
5+
2.1.0)
6+
7+
---
8+
httpbin/core.py | 4 ++--
9+
1 file changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/httpbin/core.py b/httpbin/core.py
12+
index 305c9882..2bad408e 100644
13+
--- a/httpbin/core.py
14+
+++ b/httpbin/core.py
15+
@@ -29,7 +29,7 @@
16+
from six.moves import range as xrange
17+
from werkzeug.datastructures import WWWAuthenticate, MultiDict
18+
from werkzeug.http import http_date
19+
-from werkzeug.wrappers import BaseResponse
20+
+from werkzeug.wrappers import Response
21+
from werkzeug.http import parse_authorization_header
22+
from flasgger import Swagger, NO_SANITIZER
23+
24+
@@ -77,7 +77,7 @@ def jsonify(*args, **kwargs):
25+
26+
27+
# Prevent WSGI from correcting the casing of the Location header
28+
-BaseResponse.autocorrect_location_header = False
29+
+Response.autocorrect_location_header = False
30+
31+
# Find the correct template folder when running from a different location
32+
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates")

0 commit comments

Comments
 (0)