1
0
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:
Cameron Dershem
2019-06-28 13:31:30 -04:00
parent cbf046b1f0
commit 5133ab874d
40 changed files with 116 additions and 81 deletions

View File

@ -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};

View File

@ -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")

View File

@ -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")