Skip to content

Commit 3609964

Browse files
OhYeeSodawyx
authored andcommitted
fix(ram_signature): use unquote_plus for query parameter decoding
Updated query parameter decoding to use unquote_plus instead of unquote for better handling of '+' characters in URLs. This change ensures that query parameters are decoded correctly, aligning with standard URL encoding practices. 修复(ram_signature):使用 unquote_plus 解码查询参数 更新查询参数解码,改用 unquote_plus 代替 unquote,以更好地处理 URL 中的 '+' 字符。此更改确保查询参数正确解码,符合标准 URL 编码实践。 Change-Id: I6d8af91c3ac3512cf8b9a96dda4501a643e8fa66 Signed-off-by: OhYee <oyohyee@oyohyee.com>
1 parent 46e9249 commit 3609964

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

agentrun/utils/ram_signature/signer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import hashlib
1313
import hmac
1414
from typing import Optional
15-
from urllib.parse import quote, unquote, urlparse
15+
from urllib.parse import quote, unquote_plus, urlparse
1616

1717
ALGORITHM = "AGENTRUN4-HMAC-SHA256"
1818
UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"
@@ -156,7 +156,7 @@ def get_agentrun_signed_headers(
156156
for pair in parsed.query.split("&"):
157157
if "=" in pair:
158158
k, v = pair.split("=", 1)
159-
query_params[unquote(k)] = unquote(v)
159+
query_params[unquote_plus(k)] = unquote_plus(v)
160160

161161
now = sign_time if sign_time is not None else datetime.now(timezone.utc)
162162
if now.tzinfo is None:

0 commit comments

Comments
 (0)