File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1- use async_std:: fs:: File ;
2- use async_std:: io:: BufReader ;
31use async_std:: net:: { TcpListener , TcpStream } ;
42use async_std:: prelude:: * ;
53use async_std:: task;
6- use http_types:: { Body , Response , StatusCode } ;
4+ use http_types:: { Response , StatusCode } ;
75
86#[ async_std:: main]
97async fn main ( ) -> http_types:: Result < ( ) > {
@@ -32,11 +30,7 @@ async fn accept(addr: String, stream: TcpStream) -> http_types::Result<()> {
3230 async_h1:: accept ( & addr, stream. clone ( ) , |_req| async move {
3331 let mut res = Response :: new ( StatusCode :: Ok ) ;
3432 res. insert_header ( "Content-Type" , "text/plain" ) ?;
35- let body = Body :: from_reader (
36- BufReader :: new ( File :: open ( "tests/fixtures/zeros.txt" ) . await ?) ,
37- None ,
38- ) ;
39- res. set_body ( body) ;
33+ res. set_body ( "Hello world" ) ;
4034 Ok ( res)
4135 } )
4236 . await ?;
You can’t perform that action at this time.
0 commit comments