Replies: 1 comment
-
Yep, looking at the API, I'd say cloning the request is the intended approach for this. Roughly along the lines of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a pretty strange case: a piece of hardware is sending an invalid Sec-WebSocket-Key header. It is 18 bytes instead of 16. There is no chance that the vendor will fix it but I still need this connection.
My idea was to swap the original header with some default and then generate the accept key in the middleware or on_response_prepare signal, but it looks like I can't modify the incoming headers in either of them.
How do I override the headers?
Thank you.
EDIT: I've found a way with middleware + on_response_prepare: in the middleware I'm cloning the request and replacing the headers. I'm not sure if that's safe enough though.
Beta Was this translation helpful? Give feedback.
All reactions