David Pedersen

Results 309 comments of David Pedersen

That crate seems similar to [mime](https://crates.io/crates/mime) which I believe tower-http already uses already.

If we can use mime then I think we should do that.

> Servers like axum and actix-web provide other mechanisms for timeouts when receiving things like request headers From a tower middleware it's not possible to distinguish between reading the request...

But not all servers are proxies so 504 doesn't seem right to me. > The HyperText Transfer Protocol (HTTP) 504 Gateway Timeout server error response code indicates that the server,...

Sure we can add a method to change the status code. I don't think we should allow customizing the response body. If people need that I'd recommend writing your own...

I agree with @jonhoo and @Darksonn. Not sure this needs to be built in :thinking: I don't feel it gives you much outside of using the builder directly.

FYI I've filed a rustsec about this for tower-http https://github.com/rustsec/advisory-db/pull/1159. The vulnerable code in tower-http was based on code from warp. Might wanna do the same for warp 👀

> Any web framework which supports io_uring? Unlikely given that most frameworks are built on top of hyper. There is this https://github.com/actix/actix-web/issues/2404 but thats specifically for files 🤷

@Geal this is exactly how tower-http's [`Trace` middleware](https://docs.rs/tower-http/0.2.0/tower_http/trace/index.html) works. The span it creates lasts from request is received until the entire response body is sent (or earlier if the client...

Tower recently got [`tower::make::Shared`](https://docs.rs/tower/0.4.7/tower/make/struct.Shared.html) which changes this ```rust let server = Server::bind(&addr).serve(make_service_fn(|_| async move { Ok::(service_fn(handler)) })); ``` Into this ```rust let server = Server::bind(&addr).serve(Shared::new(service_fn(handler)); ``` There is also an...