Fix overly permissive regular expression. (#21777)

This commit is contained in:
jack-edmonds-dd
2025-08-21 01:44:49 -04:00
committed by GitHub
parent 8c0f8677f0
commit caf53ac6c4
6 changed files with 8 additions and 6 deletions

View File

@@ -412,7 +412,7 @@ class ApiClient:
data = json.loads(response_text)
except ValueError:
data = response_text
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
if response_text == "":
data = ""
else: