From 422da6ded233da20be836f673fbf9906c192d985 Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Thu, 18 Jan 2024 20:50:25 +0800 Subject: [PATCH] The auth_basic() decorator doesn't use functools.wraps(). Signed-off-by: zhang-liang-pengkun --- ...decorator-doesnt-use-functools-wraps.patch | 24 +++++++++++++++++++ python-bottle.spec | 6 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 0009-auth-basic-decorator-doesnt-use-functools-wraps.patch diff --git a/0009-auth-basic-decorator-doesnt-use-functools-wraps.patch b/0009-auth-basic-decorator-doesnt-use-functools-wraps.patch new file mode 100644 index 0000000..c735887 --- /dev/null +++ b/0009-auth-basic-decorator-doesnt-use-functools-wraps.patch @@ -0,0 +1,24 @@ +From e1be22df61b9d545b7af3d8990603f4782eecced Mon Sep 17 00:00:00 2001 +From: Alice Goldfuss +Date: Tue, 11 Feb 2014 17:14:26 -0800 +Subject: [PATCH] Fix for Issue #586 + +--- + bottle.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/bottle.py b/bottle.py +index 406762f..04ccf7d 100644 +--- a/bottle.py ++++ b/bottle.py +@@ -2689,6 +2689,7 @@ def auth_basic(check, realm="private", text="Access denied"): + ''' Callback decorator to require HTTP auth (basic). + TODO: Add route(check_auth=...) parameter. ''' + def decorator(func): ++ @functools.wraps(func) + def wrapper(*a, **ka): + user, password = request.auth or (None, None) + if user is None or not check(user, password): +-- +2.39.0.windows.2 + diff --git a/python-bottle.spec b/python-bottle.spec index 726e8fb..7c5b6a0 100644 --- a/python-bottle.spec +++ b/python-bottle.spec @@ -1,6 +1,6 @@ Name: python-bottle Version: 0.12.13 -Release: 18 +Release: 19 Summary: WSGI micro web-framework for Python. License: MIT URL: https://github.com/bottlepy/bottle @@ -16,6 +16,7 @@ Patch0006: 0005-fix-1148-redirect-and-non-ascii-characters.patch Patch0007: 0006-1177-Bug-fix-of-missing-regex-escaped-back-slashes.patch Patch0008: 0007-Fix-the-Allow-header-value-in-405-Method-not-allowed.patch Patch0009: 0008-Fix-Multipart-file-uploads-with-empty-filename-not-d.patch +Patch0010: 0009-auth-basic-decorator-doesnt-use-functools-wraps.patch BuildArch: noarch BuildRequires: python3-devel python3-setuptools @@ -53,6 +54,9 @@ sed -i '/^#!/d' bottle.py %exclude %{_bindir}/bottle.py %changelog +* Thu Jan 18 2024 zhangliangpengkun - 0.12.13-19 +- The auth_basic() decorator doesn't use functools.wraps(). + * Fri Jan 12 2024 zhangliangpengkun - 0.12.13-18 - Fix: Multipart file uploads with empty filename not detected as binary. -- Gitee