Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Allow header to 405 responses as required by RFC 7231 #1436

Merged
merged 5 commits into from
Jan 26, 2022

Conversation

adriangb
Copy link
Member

@adriangb adriangb commented Jan 26, 2022

To be applied on top of #1435, replaces #1434

starlette/endpoints.py Outdated Show resolved Hide resolved
Copy link
Member

@tomchristie tomchristie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fab, yup. One bit of feedback, but up to you.

method
for method in ("GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
if getattr(self, method.lower(), None) is not None
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super. 🌟

@adriangb adriangb merged commit 79812bb into encode:master Jan 26, 2022
@adriangb adriangb deleted the add-allow-headers-to-405-responses branch January 26, 2022 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants