Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
make it X-Deprecation-Override
Browse files Browse the repository at this point in the history
  • Loading branch information
argl committed Oct 7, 2024
1 parent 51ac0db commit d4e6212
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions httpobs/website/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def wrapper(*args, **kwargs):

def check_for_deprecation_override_header(fn):
"""
Checks for the "Deprecation-Override" header and sets the response accordingly:
Checks for the "X-Deprecation-Override" header and sets the response accordingly:
- If the header is set to "yes", it will return the response as normal
- If the header is set to anything else, it will return a 410 Gone response
"""
@wraps(fn)
def wrapper(*args, **kwargs):
if request.headers.get('Deprecation-Override', 'no').lower() == 'yes':
if request.headers.get('X-Deprecation-Override', 'no').lower() == 'yes':
return fn(*args, **kwargs)
else:
return make_response("""
Expand All @@ -38,7 +38,7 @@ def wrapper(*args, **kwargs):
If you really want to continue with this endpoint for now,
please add a header to your request in the form of
Deprecation-Override: yes
X-Deprecation-Override: yes
Be aware that this API will go away without further warning on Oct 31, 2024.
""", 410)
Expand Down

0 comments on commit d4e6212

Please sign in to comment.