mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 09:59:21 +02:00
drop deprecated code
This commit is contained in:
@ -172,12 +172,11 @@ and is on for *HTTP/1.1* and *HTTP/2.0*.
|
||||
|
||||
```rust
|
||||
# extern crate actix_web;
|
||||
# use actix_web::httpcodes::*;
|
||||
use actix_web::*;
|
||||
use actix_web::{header, HttpRequest, HttpResponse, httpcodes::HttpOk};
|
||||
|
||||
fn index(req: HttpRequest) -> HttpResponse {
|
||||
HttpOk.build()
|
||||
.connection_type(headers::ConnectionType::Close) // <- Close connection
|
||||
.connection_type(header::ConnectionType::Close) // <- Close connection
|
||||
.force_close() // <- Alternative method
|
||||
.finish().unwrap()
|
||||
}
|
||||
|
@ -12,8 +12,7 @@ builder instance multiple times, the builder will panic.
|
||||
|
||||
```rust
|
||||
# extern crate actix_web;
|
||||
use actix_web::*;
|
||||
use actix_web::headers::ContentEncoding;
|
||||
use actix_web::{HttpRequest, HttpResponse, header::ContentEncoding};
|
||||
|
||||
fn index(req: HttpRequest) -> HttpResponse {
|
||||
HttpResponse::Ok()
|
||||
@ -46,8 +45,7 @@ to enable `brotli` use `ContentEncoding::Br`:
|
||||
|
||||
```rust
|
||||
# extern crate actix_web;
|
||||
use actix_web::*;
|
||||
use actix_web::headers::ContentEncoding;
|
||||
use actix_web::{HttpRequest, HttpResponse, header::ContentEncoding};
|
||||
|
||||
fn index(req: HttpRequest) -> HttpResponse {
|
||||
HttpResponse::Ok()
|
||||
|
Reference in New Issue
Block a user