mirror of
https://github.com/actix/actix-website
synced 2025-02-08 22:36:07 +01:00
19 lines
568 B
Rust
19 lines
568 B
Rust
|
// <identity-two>
|
||
|
use actix_web::{
|
||
|
http::ContentEncoding, middleware::BodyEncoding, HttpRequest, HttpResponse,
|
||
|
};
|
||
|
|
||
|
static HELLO_WORLD: &[u8] = &[
|
||
|
0x1f, 0x8b, 0x08, 0x00, 0xa2, 0x30, 0x10, 0x5c, 0x00, 0x03, 0xcb, 0x48, 0xcd, 0xc9,
|
||
|
0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, 0x02, 0x00, 0x2d, 0x3b, 0x08, 0xaf,
|
||
|
0x0c, 0x00, 0x00, 0x00,
|
||
|
];
|
||
|
|
||
|
pub fn index(_req: HttpRequest) -> HttpResponse {
|
||
|
HttpResponse::Ok()
|
||
|
.encoding(ContentEncoding::Identity)
|
||
|
.header("content-encoding", "gzip")
|
||
|
.body(HELLO_WORLD)
|
||
|
}
|
||
|
// </identity-two>
|