summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2024-01-28 21:34:28 -0700
committerMichael Merickel <michael@merickel.org>2024-01-28 21:40:20 -0700
commitd545eef5f5411c0236f04ead9e4e52d93d9a2451 (patch)
tree14516e1e240103d6b76e6a04b63d150be14fc7ea /src
parent55f9eb0bb0b72fe60ecde7529edbc27aceade187 (diff)
downloadpyramid-d545eef5f5411c0236f04ead9e4e52d93d9a2451.tar.gz
pyramid-d545eef5f5411c0236f04ead9e4e52d93d9a2451.tar.bz2
pyramid-d545eef5f5411c0236f04ead9e4e52d93d9a2451.zip
fix BadCSRFOrigin and BadCSRFToken returning invalid HTTP status lines
Diffstat (limited to 'src')
-rw-r--r--src/pyramid/exceptions.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/pyramid/exceptions.py b/src/pyramid/exceptions.py
index 16aeb7e4f..9f19a4bb4 100644
--- a/src/pyramid/exceptions.py
+++ b/src/pyramid/exceptions.py
@@ -10,12 +10,11 @@ class BadCSRFOrigin(HTTPBadRequest):
origin validation.
"""
- title = "Bad CSRF Origin"
explanation = (
- "Access is denied. This server can not verify that the origin or "
- "referrer of your request matches the current site. Either your "
- "browser supplied the wrong Origin or Referrer or it did not supply "
- "one at all."
+ "Bad CSRF Origin. Access is denied. This server can not verify that "
+ "the origin or referrer of your request matches the current site. "
+ "Either your browser supplied the wrong Origin or Referrer or it did "
+ "not supply one at all."
)
@@ -25,14 +24,13 @@ class BadCSRFToken(HTTPBadRequest):
forgery token validation.
"""
- title = 'Bad CSRF Token'
explanation = (
- 'Access is denied. This server can not verify that your cross-site '
- 'request forgery token belongs to your login session. Either you '
- 'supplied the wrong cross-site request forgery token or your session '
- 'no longer exists. This may be due to session timeout or because '
- 'browser is not supplying the credentials required, as can happen '
- 'when the browser has cookies turned off.'
+ 'Bad CSRF token received. Access is denied. This server can not '
+ 'verify that your cross-site request forgery token belongs to your '
+ 'login session. Either you supplied the wrong cross-site request '
+ 'forgery token or your session no longer exists. This may be due to '
+ 'session timeout or because browser is not supplying the credentials '
+ 'required, as can happen when the browser has cookies turned off.'
)