Apply ruff fixes
This commit is contained in:
committed by
Abhimanyu Saharan
parent
0896b0772d
commit
a66765a514
@@ -203,11 +203,13 @@ def _verify_webhook_signature(
|
||||
)
|
||||
|
||||
|
||||
_REDACTED_HEADERS = frozenset({
|
||||
"x-hub-signature-256",
|
||||
"x-webhook-signature",
|
||||
"authorization",
|
||||
})
|
||||
_REDACTED_HEADERS = frozenset(
|
||||
{
|
||||
"x-hub-signature-256",
|
||||
"x-webhook-signature",
|
||||
"authorization",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def _captured_headers(request: Request) -> dict[str, str] | None:
|
||||
|
||||
@@ -687,9 +687,7 @@ def _sanitize_field(value: str) -> str:
|
||||
Prevents prompt injection via skill name or URL fields that could
|
||||
break out of the structured data section into the instruction section.
|
||||
"""
|
||||
sanitized = "".join(
|
||||
ch if ch.isprintable() and ch not in {"\n", "\r"} else " " for ch in value
|
||||
)
|
||||
sanitized = "".join(ch if ch.isprintable() and ch not in {"\n", "\r"} else " " for ch in value)
|
||||
# Normalize any runs of whitespace (including tabs) down to single spaces.
|
||||
sanitized = re.sub(r"\s+", " ", sanitized)
|
||||
return sanitized.strip()
|
||||
|
||||
@@ -494,5 +494,3 @@ class TestWebhookPayloadSizeLimit:
|
||||
# ---------------------------------------------------------------------------
|
||||
# Task 12: Gateway token redaction
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user