1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 14:49:20 +02:00

remove cookie support from -http (#2065)

This commit is contained in:
Rob Ede
2021-04-09 18:07:10 +01:00
committed by GitHub
parent c72d77065d
commit 44c55dd036
40 changed files with 1335 additions and 566 deletions

View File

@ -11,7 +11,7 @@ use std::{
};
use actix_codec::Encoder;
use actix_http::{error::Error, ws, HttpService, Request, Response};
use actix_http::{body::BodyStream, error::Error, ws, HttpService, Request, Response};
use actix_rt::time::{interval, Interval};
use actix_server::Server;
use bytes::{Bytes, BytesMut};
@ -34,14 +34,14 @@ async fn main() -> io::Result<()> {
.await
}
async fn handler(req: Request) -> Result<Response, Error> {
async fn handler(req: Request) -> Result<Response<BodyStream<Heartbeat>>, Error> {
log::info!("handshaking");
let mut res = ws::handshake(req.head())?;
// handshake will always fail under HTTP/2
log::info!("responding");
Ok(res.streaming(Heartbeat::new(ws::Codec::new())))
Ok(res.message_body(BodyStream::new(Heartbeat::new(ws::Codec::new()))))
}
struct Heartbeat {