mirror of
https://github.com/actix/actix-website
synced 2025-06-27 15:39:02 +02:00
Final fixes before requesting review.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// <chunked>
|
||||
// // <chunked>
|
||||
// use actix_web::{web, HttpRequest, HttpResponse};
|
||||
// use bytes::Bytes;
|
||||
// use futures::stream::once;
|
||||
@ -10,7 +10,7 @@
|
||||
// b"data",
|
||||
// ))))))
|
||||
// }
|
||||
// </chunked>
|
||||
// // </chunked>
|
||||
|
||||
// pub fn main() {
|
||||
// use actix_web::{web, App, HttpServer};
|
||||
|
@ -1,7 +1,6 @@
|
||||
// <identity-two>
|
||||
use actix_web::{
|
||||
http::ContentEncoding, middleware, middleware::BodyEncoding, HttpRequest,
|
||||
HttpResponse,
|
||||
http::ContentEncoding, middleware, middleware::BodyEncoding, HttpResponse,
|
||||
};
|
||||
|
||||
static HELLO_WORLD: &[u8] = &[
|
||||
@ -10,7 +9,7 @@ static HELLO_WORLD: &[u8] = &[
|
||||
0x0c, 0x00, 0x00, 0x00,
|
||||
];
|
||||
|
||||
pub fn index(_req: HttpRequest) -> HttpResponse {
|
||||
pub fn index() -> HttpResponse {
|
||||
HttpResponse::Ok()
|
||||
.encoding(ContentEncoding::Identity)
|
||||
.header("content-encoding", "gzip")
|
||||
|
@ -7,11 +7,10 @@ pub mod identity_two;
|
||||
pub mod json_resp;
|
||||
|
||||
// <builder>
|
||||
use actix_web::{http::ContentEncoding, middleware::BodyEncoding, HttpResponse};
|
||||
use actix_web::HttpResponse;
|
||||
|
||||
fn index() -> HttpResponse {
|
||||
HttpResponse::Ok()
|
||||
.encoding(ContentEncoding::Br)
|
||||
.content_type("plain/text")
|
||||
.header("X-Hdr", "sample")
|
||||
.body("data")
|
||||
|
Reference in New Issue
Block a user