Skip to content

Add headers parameter to HTTPException#1435

Merged
Kludex merged 3 commits intomasterfrom
feat/httpexception-headers-param
Jan 26, 2022
Merged

Add headers parameter to HTTPException#1435
Kludex merged 3 commits intomasterfrom
feat/httpexception-headers-param

Conversation

@Kludex
Copy link
Owner

@Kludex Kludex commented Jan 26, 2022

Idea from @adriangb : #1434 (comment)

The PR #1434 created a use-case for HTTPException.headers. FastAPI already makes use of this, as mentioned by Adrian on https://github.com/tiangolo/fastapi/blob/291180bf2d8c39e84860c2426b1d58b6c80f6fef/fastapi/exceptions.py#L13 .

PR open for discussion. :)

@lovelydinosaur
Copy link
Contributor

Seems pretty reasonable to me yeah.

@lovelydinosaur
Copy link
Contributor

Needs a lil' docs update on https://www.starlette.io/exceptions/ - then I think it's ready to go.

@Kludex Kludex requested a review from lovelydinosaur January 26, 2022 11:14
Copy link
Contributor

@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

This looks great! We should just test it against FastAPI first to at least know if it will be breaking for them. I don't think it will be.

@adriangb
Copy link
Contributor

This looks great! We should just test it against FastAPI first to at least know if it will be breaking for them. I don't think it will be.

Well I tried, a bunch of other things are broken. But just eyeballing the change, I don't see how it would break FastAPI. So I think we're good to go on this!

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.

4 participants