summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2024-01-28 22:57:17 -0700
committerGitHub <noreply@github.com>2024-01-28 22:57:17 -0700
commite77b72dc3a0890911514ad8aab8c8bf26c4591d0 (patch)
tree569b1b1d53415f7f8fc692c632926f08611cccf9 /src
parent8de7b1f2b5df9a9225c514b2cfc5e5e0919daac2 (diff)
parent3abbab66159286e98a32a53e9b3a6c4705c69679 (diff)
downloadpyramid-e77b72dc3a0890911514ad8aab8c8bf26c4591d0.tar.gz
pyramid-e77b72dc3a0890911514ad8aab8c8bf26c4591d0.tar.bz2
pyramid-e77b72dc3a0890911514ad8aab8c8bf26c4591d0.zip
Merge pull request #3742 from Pylons/fix-csrf-400-status
Fix csrf 400 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.'
)