1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 15:07:42 +02:00

remove http-codes builders from actix-http (#2159)

This commit is contained in:
Rob Ede
2021-04-14 02:00:14 +01:00
committed by GitHub
parent 02ced426fd
commit 23e0c9b6e0
21 changed files with 539 additions and 573 deletions

View File

@ -1,6 +1,6 @@
use std::{env, io};
use actix_http::{body::Body, http::HeaderValue};
use actix_http::{body::Body, http::HeaderValue, http::StatusCode};
use actix_http::{Error, HttpService, Request, Response};
use actix_server::Server;
use bytes::BytesMut;
@ -14,7 +14,7 @@ async fn handle_request(mut req: Request) -> Result<Response<Body>, Error> {
}
info!("request body: {:?}", body);
Ok(Response::Ok()
Ok(Response::build(StatusCode::OK)
.insert_header(("x-head", HeaderValue::from_static("dummy value!")))
.body(body))
}