python-bottle/0009-Fix-for-Issue-586.patch
zhang-liang-pengkun 6ff6c07da6 The auth_basic() decorator doesn't use functools.wraps().
Signed-off-by: zhang-liang-pengkun <zhangliangpengkun@xfusion.com>
2024-01-12 15:50:27 +08:00

25 lines
767 B
Diff

From e1be22df61b9d545b7af3d8990603f4782eecced Mon Sep 17 00:00:00 2001
From: Alice Goldfuss <alice@newrelic.com>
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