Ensure changes to the status attribute are written to the transport.#656
Ensure changes to the status attribute are written to the transport.#656nhoad wants to merge 1 commit intoaio-libs:masterfrom
Conversation
|
Please elaborate why do you need to modify status code? From my perspective http proxy can write different status line if needed without changing aiohttp. |
|
By default the proxy sets the status code to 200, assuming success. It sends a modified version of the request upstream, which may or may not return a 200, at which point the status code to be sent to the client needs to be modified. Without this patch, the only way to do that is by modifying |
|
I still believe proxy should get response from upstream and send a copy of it to client. No need for inplace request/response modification. All work can be done without aiohttp changing. Even if |
|
Then as an alternative, modifying the |
|
Converting |
|
Fixed by #710 |
I'm writing a proxy with aiohttp, and I need the possibility of modifying the response status code under certain conditions, something that currently isn't possible.
Personally I'm not a big fan for how I've done the handling of the
reasonof the attribute, but I can't think of a better way to do this.