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

modifying request object #682

Closed
ghost opened this issue Dec 15, 2015 · 4 comments
Closed

modifying request object #682

ghost opened this issue Dec 15, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 15, 2015

Hi,

The Request object is currently read only.
I think it would be usefull to be able to modify request headers in a middleware for example.
Being able to add stuff in the request object is nice, but so is having code that don't rely on it (that event works when the middleware is not there)

@jashandeep-sohi
Copy link
Contributor

Perhaps you are looking for Signals?

@asvetlov
Copy link
Member

@jashandeep-sohi perhaps you muddled request and response.
Request.headers is immutable object (MultiDictProxy actually).

Cloning request with replacing headers is satisfactory solution. Other request's attributes may be added later.

@jashandeep-sohi
Copy link
Contributor

@asvetlov Ahh, yes -- Been working with responses so much, every "r" word is a "response" in my head now ;-)

@asvetlov
Copy link
Member

asvetlov commented Nov 4, 2016

Fixed by #1361

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

No branches or pull requests

2 participants