surf icon indicating copy to clipboard operation
surf copied to clipboard

http-types::Response::new might panic

Open mihai-dinculescu opened this issue 3 years ago • 0 comments

The current implementation of http-types::Response::new will panic on non-standard error codes such as the 52x ones returned by Cloudflare.

It looks like instead of returning an Ok(Response::new(res.into())), the send function should first test the StatusCode with StatusCode::try_from::<u16>.

I have also created an issue in http-types.

mihai-dinculescu avatar Aug 01 '22 18:08 mihai-dinculescu