Skip to content

Switch environ usage to headers in request mixins#1808

Merged
davidism merged 1 commit into
pallets:masterfrom
pgjones:request_wrapper_headers
Oct 14, 2020
Merged

Switch environ usage to headers in request mixins#1808
davidism merged 1 commit into
pallets:masterfrom
pgjones:request_wrapper_headers

Conversation

@pgjones

@pgjones pgjones commented May 16, 2020

Copy link
Copy Markdown
Member

This allows these mixins to be used in ASGI frameworks that have no
concept of environs but do have headers.

The downside is the extra indirection, although the headers are a cached property and the environ/headers are immutable.

@davidism davidism added this to the 2.0.0 milestone Oct 14, 2020
@davidism davidism force-pushed the request_wrapper_headers branch from 719ccbc to 17253eb Compare October 14, 2020 18:02
This allows these mixins to be used in ASGI frameworks that have no
concept of environs but do have headers.
@davidism davidism force-pushed the request_wrapper_headers branch from 17253eb to bb67981 Compare October 14, 2020 18:14
@davidism

Copy link
Copy Markdown
Member

Had to add # type: ignore to the mixins, luckily there weren't a lot of uses. I've been thinking about this for a while, but I really think the mixins should inherit from BaseRequest. Or they should mostly be integrated into BaseRequest or Request since they don't add any overhead, just more attributes and methods.

@davidism davidism merged commit 7b3e34d into pallets:master Oct 14, 2020
@pgjones

pgjones commented Oct 14, 2020

Copy link
Copy Markdown
Member Author

Thanks 🎉

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 13, 2020
@pgjones pgjones deleted the request_wrapper_headers branch June 11, 2022 09:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants