From f5636f321bb7f8318f3676339e6c9ff294327ac8 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 29 Mar 2018 11:06:44 -0700 Subject: [PATCH] drop deprecated code --- CHANGES.md | 2 +- guide/src/qs_3_5.md | 5 ++-- guide/src/qs_7.md | 6 ++-- src/application.rs | 2 +- src/client/pipeline.rs | 2 +- src/client/request.rs | 2 +- src/httpresponse.rs | 2 +- src/lib.rs | 12 +------- src/pipeline.rs | 2 +- src/route.rs | 6 ---- src/server/h1writer.rs | 2 +- src/server/h2writer.rs | 2 +- src/server/mod.rs | 2 +- src/test.rs | 42 ---------------------------- src/ws/client.rs | 18 ------------ src/ws/mod.rs | 12 -------- tests/test_client.rs | 32 +++++++++++----------- tests/test_server.rs | 62 +++++++++++++++++++++--------------------- 18 files changed, 61 insertions(+), 152 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 640c05e9..ed0fc52d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Changes -## 0.4.11 +## 0.5.0 * Type-safe path/query parameter handling, using serde #70 diff --git a/guide/src/qs_3_5.md b/guide/src/qs_3_5.md index 3b01e49d..7d978fee 100644 --- a/guide/src/qs_3_5.md +++ b/guide/src/qs_3_5.md @@ -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() } diff --git a/guide/src/qs_7.md b/guide/src/qs_7.md index f04a5b6c..9509f45b 100644 --- a/guide/src/qs_7.md +++ b/guide/src/qs_7.md @@ -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() diff --git a/src/application.rs b/src/application.rs index 86b16cd2..56f26b22 100644 --- a/src/application.rs +++ b/src/application.rs @@ -6,7 +6,7 @@ use std::collections::HashMap; use handler::Reply; use router::{Router, Pattern}; use resource::Resource; -use headers::ContentEncoding; +use header::ContentEncoding; use handler::{Handler, RouteHandler, WrapHandler}; use httprequest::HttpRequest; use pipeline::{Pipeline, PipelineHandler}; diff --git a/src/client/pipeline.rs b/src/client/pipeline.rs index f4b556bc..19ccf892 100644 --- a/src/client/pipeline.rs +++ b/src/client/pipeline.rs @@ -11,7 +11,7 @@ use actix::prelude::*; use error::Error; use body::{Body, BodyStream}; use context::{Frame, ActorHttpContext}; -use headers::ContentEncoding; +use header::ContentEncoding; use httpmessage::HttpMessage; use error::PayloadError; use server::WriterState; diff --git a/src/client/request.rs b/src/client/request.rs index 49206b0b..01c15fa8 100644 --- a/src/client/request.rs +++ b/src/client/request.rs @@ -449,7 +449,7 @@ impl ClientRequestBuilder { /// # use actix_web::*; /// # use actix_web::httpcodes::*; /// # - /// use actix_web::headers::Cookie; + /// use actix_web::header::Cookie; /// use actix_web::client::ClientRequest; /// /// fn main() { diff --git a/src/httpresponse.rs b/src/httpresponse.rs index 21000de6..df227100 100644 --- a/src/httpresponse.rs +++ b/src/httpresponse.rs @@ -421,7 +421,7 @@ impl HttpResponseBuilder { /// # use actix_web::*; /// # use actix_web::httpcodes::*; /// # - /// use actix_web::headers::Cookie; + /// use actix_web::header::Cookie; /// /// fn index(req: HttpRequest) -> Result { /// Ok(HttpOk.build() diff --git a/src/lib.rs b/src/lib.rs index 4003cefc..367b9b65 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -139,7 +139,7 @@ pub use application::Application; pub use httpmessage::HttpMessage; pub use httprequest::HttpRequest; pub use httpresponse::HttpResponse; -pub use handler::{Either, Responder, NormalizePath, AsyncResponder, FutureResponse}; +pub use handler::{Either, Responder, AsyncResponder, FutureResponse}; pub use context::HttpContext; pub use server::HttpServer; pub use extractor::{Path, Query}; @@ -157,16 +157,6 @@ pub(crate) const HAS_TLS: bool = true; #[cfg(not(feature="tls"))] pub(crate) const HAS_TLS: bool = false; -#[doc(hidden)] -#[deprecated(since="0.4.4", note="please use `actix::header` module")] -pub mod headers { - //! Headers implementation - pub use httpresponse::ConnectionType; - pub use cookie::{Cookie, CookieBuilder}; - pub use http_range::HttpRange; - pub use header::ContentEncoding; -} - pub mod helpers { //! Various helpers diff --git a/src/pipeline.rs b/src/pipeline.rs index b5772e9a..d8a5dcfb 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -10,7 +10,7 @@ use futures::unsync::oneshot; use body::{Body, BodyStream}; use context::{Frame, ActorHttpContext}; use error::Error; -use headers::ContentEncoding; +use header::ContentEncoding; use handler::{Reply, ReplyItem}; use httprequest::HttpRequest; use httpresponse::HttpResponse; diff --git a/src/route.rs b/src/route.rs index 4213c70d..6f1f4192 100644 --- a/src/route.rs +++ b/src/route.rs @@ -79,12 +79,6 @@ impl Route { self } - #[doc(hidden)] - #[deprecated(since="0.4.1", note="please use `.filter()` instead")] - pub fn p + 'static>(&mut self, p: T) -> &mut Self { - self.filter(p) - } - /// Set handler object. Usually call to this method is last call /// during route configuration, so it does not return reference to self. pub fn h>(&mut self, handler: H) { diff --git a/src/server/h1writer.rs b/src/server/h1writer.rs index 0e01c8c1..ef2a6089 100644 --- a/src/server/h1writer.rs +++ b/src/server/h1writer.rs @@ -9,7 +9,7 @@ use http::{Method, Version}; use http::header::{HeaderValue, CONNECTION, CONTENT_LENGTH, DATE}; use body::{Body, Binary}; -use headers::ContentEncoding; +use header::ContentEncoding; use httprequest::HttpInnerMessage; use httpresponse::HttpResponse; use super::helpers; diff --git a/src/server/h2writer.rs b/src/server/h2writer.rs index 17c4de1a..f8c139f4 100644 --- a/src/server/h2writer.rs +++ b/src/server/h2writer.rs @@ -10,7 +10,7 @@ use http::{Version, HttpTryFrom, Response}; use http::header::{HeaderValue, CONNECTION, TRANSFER_ENCODING, DATE, CONTENT_LENGTH}; use body::{Body, Binary}; -use headers::ContentEncoding; +use header::ContentEncoding; use httprequest::HttpInnerMessage; use httpresponse::HttpResponse; use super::helpers; diff --git a/src/server/mod.rs b/src/server/mod.rs index 1b80b771..1e173fc4 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -25,7 +25,7 @@ pub use self::settings::ServerSettings; use body::Binary; use error::Error; -use headers::ContentEncoding; +use header::ContentEncoding; use httprequest::{HttpInnerMessage, HttpRequest}; use httpresponse::HttpResponse; diff --git a/src/test.rs b/src/test.rs index 97ddba40..3adeca85 100644 --- a/src/test.rs +++ b/src/test.rs @@ -133,48 +133,6 @@ impl TestServer { } } - #[deprecated(since="0.4.10", - note="please use `TestServer::build_with_state()` instead")] - /// Start new test server with custom application state - /// - /// This method accepts state factory and configuration method. - pub fn with_state(state: FS, config: F) -> Self - where S: 'static, - FS: Sync + Send + 'static + Fn() -> S, - F: Sync + Send + 'static + Fn(&mut TestApp), - { - let (tx, rx) = mpsc::channel(); - - // run server in separate thread - let join = thread::spawn(move || { - let sys = System::new("actix-test-server"); - - let tcp = net::TcpListener::bind("127.0.0.1:0").unwrap(); - let local_addr = tcp.local_addr().unwrap(); - let tcp = TcpListener::from_listener(tcp, &local_addr, Arbiter::handle()).unwrap(); - - HttpServer::new(move || { - let mut app = TestApp::new(state()); - config(&mut app); - vec![app]} - ).disable_signals().start_incoming(tcp.incoming(), false); - - tx.send((Arbiter::system(), local_addr)).unwrap(); - let _ = sys.run(); - }); - - let system = System::new("actix-test"); - let (server_sys, addr) = rx.recv().unwrap(); - TestServer { - addr, - server_sys, - system, - ssl: false, - conn: TestServer::get_conn(), - thread: Some(join), - } - } - fn get_conn() -> Addr { #[cfg(feature="alpn")] { diff --git a/src/ws/client.rs b/src/ws/client.rs index 8b7fa2d6..7372832f 100644 --- a/src/ws/client.rs +++ b/src/ws/client.rs @@ -32,24 +32,6 @@ use super::frame::Frame; use super::proto::{CloseCode, OpCode}; -/// Backward compatibility -#[doc(hidden)] -#[deprecated(since="0.4.2", note="please use `ws::Client` instead")] -pub type WsClient = Client; -#[doc(hidden)] -#[deprecated(since="0.4.2", note="please use `ws::ClientError` instead")] -pub type WsClientError = ClientError; -#[doc(hidden)] -#[deprecated(since="0.4.2", note="please use `ws::ClientReader` instead")] -pub type WsClientReader = ClientReader; -#[doc(hidden)] -#[deprecated(since="0.4.2", note="please use `ws::ClientWriter` instead")] -pub type WsClientWriter = ClientWriter; -#[doc(hidden)] -#[deprecated(since="0.4.2", note="please use `ws::ClientHandshake` instead")] -pub type WsClientHandshake = ClientHandshake; - - /// Websocket client error #[derive(Fail, Debug)] pub enum ClientError { diff --git a/src/ws/mod.rs b/src/ws/mod.rs index f9f8563b..5b408eb5 100644 --- a/src/ws/mod.rs +++ b/src/ws/mod.rs @@ -70,18 +70,6 @@ pub use self::context::WebsocketContext; pub use self::client::{Client, ClientError, ClientReader, ClientWriter, ClientHandshake}; -#[allow(deprecated)] -pub use self::client::{WsClient, WsClientError, - WsClientReader, WsClientWriter, WsClientHandshake}; - -/// Backward compatibility -#[doc(hidden)] -#[deprecated(since="0.4.2", note="please use `ws::ProtocolError` instead")] -pub type WsError = ProtocolError; -#[doc(hidden)] -#[deprecated(since="0.4.2", note="please use `ws::HandshakeError` instead")] -pub type WsHandshakeError = HandshakeError; - /// Websocket protocol errors #[derive(Fail, Debug)] pub enum ProtocolError { diff --git a/tests/test_client.rs b/tests/test_client.rs index 6452baef..a560ae9c 100644 --- a/tests/test_client.rs +++ b/tests/test_client.rs @@ -116,14 +116,14 @@ fn test_client_gzip_encoding() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Deflate) + .content_encoding(header::ContentEncoding::Deflate) .body(bytes)) }).responder()} )); // client request let request = srv.post() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(STR).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -142,14 +142,14 @@ fn test_client_gzip_encoding_large() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Deflate) + .content_encoding(header::ContentEncoding::Deflate) .body(bytes)) }).responder()} )); // client request let request = srv.post() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(data.clone()).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -171,14 +171,14 @@ fn test_client_gzip_encoding_large_random() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Deflate) + .content_encoding(header::ContentEncoding::Deflate) .body(bytes)) }).responder()} )); // client request let request = srv.post() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(data.clone()).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -196,14 +196,14 @@ fn test_client_brotli_encoding() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(bytes)) }).responder()} )); // client request let request = srv.client(Method::POST, "/") - .content_encoding(headers::ContentEncoding::Br) + .content_encoding(header::ContentEncoding::Br) .body(STR).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -226,14 +226,14 @@ fn test_client_brotli_encoding_large_random() { .and_then(move |bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(bytes)) }).responder()} )); // client request let request = srv.client(Method::POST, "/") - .content_encoding(headers::ContentEncoding::Br) + .content_encoding(header::ContentEncoding::Br) .body(data.clone()).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -252,14 +252,14 @@ fn test_client_deflate_encoding() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Br) + .content_encoding(header::ContentEncoding::Br) .body(bytes)) }).responder()} )); // client request let request = srv.post() - .content_encoding(headers::ContentEncoding::Deflate) + .content_encoding(header::ContentEncoding::Deflate) .body(STR).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -282,14 +282,14 @@ fn test_client_deflate_encoding_large_random() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Br) + .content_encoding(header::ContentEncoding::Br) .body(bytes)) }).responder()} )); // client request let request = srv.post() - .content_encoding(headers::ContentEncoding::Deflate) + .content_encoding(header::ContentEncoding::Deflate) .body(data.clone()).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -308,7 +308,7 @@ fn test_client_streaming_explicit() { .and_then(|body| { Ok(httpcodes::HTTPOk.build() .chunked() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(body)?)}) .responder())); @@ -329,7 +329,7 @@ fn test_body_streaming_implicit() { |app| app.handler(|_| { let body = once(Ok(Bytes::from_static(STR.as_ref()))); httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(Body::Streaming(Box::new(body)))})); let request = srv.get().finish().unwrap(); diff --git a/tests/test_server.rs b/tests/test_server.rs index d6c25f73..570d268c 100644 --- a/tests/test_server.rs +++ b/tests/test_server.rs @@ -24,7 +24,7 @@ use futures::{Future, Stream}; use futures::stream::once; use h2::client as h2client; use bytes::{Bytes, BytesMut}; -use http::{header, Request}; +use http::Request; use tokio_core::net::TcpStream; use tokio_core::reactor::Core; use rand::Rng; @@ -196,7 +196,7 @@ fn test_body_gzip() { let mut srv = test::TestServer::new( |app| app.handler( |_| httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(STR))); let request = srv.get().disable_decompress().finish().unwrap(); @@ -223,7 +223,7 @@ fn test_body_gzip_large() { let data = srv_data.clone(); app.handler( move |_| httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(data.as_ref()))}); let request = srv.get().disable_decompress().finish().unwrap(); @@ -253,7 +253,7 @@ fn test_body_gzip_large_random() { let data = srv_data.clone(); app.handler( move |_| httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(data.as_ref()))}); let request = srv.get().disable_decompress().finish().unwrap(); @@ -277,7 +277,7 @@ fn test_body_chunked_implicit() { |app| app.handler(|_| { let body = once(Ok(Bytes::from_static(STR.as_ref()))); httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(Body::Streaming(Box::new(body)))})); let request = srv.get().disable_decompress().finish().unwrap(); @@ -301,7 +301,7 @@ fn test_body_br_streaming() { |app| app.handler(|_| { let body = once(Ok(Bytes::from_static(STR.as_ref()))); httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Br) + .content_encoding(header::ContentEncoding::Br) .body(Body::Streaming(Box::new(body)))})); let request = srv.get().disable_decompress().finish().unwrap(); @@ -330,7 +330,7 @@ fn test_head_empty() { assert!(response.status().is_success()); { - let len = response.headers().get(header::CONTENT_LENGTH).unwrap(); + let len = response.headers().get(header::http::CONTENT_LENGTH).unwrap(); assert_eq!(format!("{}", STR.len()), len.to_str().unwrap()); } @@ -344,7 +344,7 @@ fn test_head_binary() { let mut srv = test::TestServer::new( |app| app.handler(|_| { httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .content_length(100).body(STR)})); let request = srv.head().finish().unwrap(); @@ -352,7 +352,7 @@ fn test_head_binary() { assert!(response.status().is_success()); { - let len = response.headers().get(header::CONTENT_LENGTH).unwrap(); + let len = response.headers().get(header::http::CONTENT_LENGTH).unwrap(); assert_eq!(format!("{}", STR.len()), len.to_str().unwrap()); } @@ -366,7 +366,7 @@ fn test_head_binary2() { let mut srv = test::TestServer::new( |app| app.handler(|_| { httpcodes::HTTPOk.build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(STR) })); @@ -375,7 +375,7 @@ fn test_head_binary2() { assert!(response.status().is_success()); { - let len = response.headers().get(header::CONTENT_LENGTH).unwrap(); + let len = response.headers().get(header::http::CONTENT_LENGTH).unwrap(); assert_eq!(format!("{}", STR.len()), len.to_str().unwrap()); } } @@ -387,7 +387,7 @@ fn test_body_length() { let body = once(Ok(Bytes::from_static(STR.as_ref()))); httpcodes::HTTPOk.build() .content_length(STR.len() as u64) - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(Body::Streaming(Box::new(body)))})); let request = srv.get().finish().unwrap(); @@ -406,7 +406,7 @@ fn test_body_chunked_explicit() { let body = once(Ok(Bytes::from_static(STR.as_ref()))); httpcodes::HTTPOk.build() .chunked() - .content_encoding(headers::ContentEncoding::Gzip) + .content_encoding(header::ContentEncoding::Gzip) .body(Body::Streaming(Box::new(body)))})); let request = srv.get().disable_decompress().finish().unwrap(); @@ -429,7 +429,7 @@ fn test_body_deflate() { |app| app.handler( |_| httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Deflate) + .content_encoding(header::ContentEncoding::Deflate) .body(STR))); // client request @@ -454,7 +454,7 @@ fn test_body_brotli() { |app| app.handler( |_| httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Br) + .content_encoding(header::ContentEncoding::Br) .body(STR))); // client request @@ -479,7 +479,7 @@ fn test_gzip_encoding() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -490,7 +490,7 @@ fn test_gzip_encoding() { let enc = e.finish().unwrap(); let request = srv.post() - .header(header::CONTENT_ENCODING, "gzip") + .header(header::http::CONTENT_ENCODING, "gzip") .body(enc.clone()).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -508,7 +508,7 @@ fn test_gzip_encoding_large() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -519,7 +519,7 @@ fn test_gzip_encoding_large() { let enc = e.finish().unwrap(); let request = srv.post() - .header(header::CONTENT_ENCODING, "gzip") + .header(header::http::CONTENT_ENCODING, "gzip") .body(enc.clone()).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -541,7 +541,7 @@ fn test_reading_gzip_encoding_large_random() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -552,7 +552,7 @@ fn test_reading_gzip_encoding_large_random() { let enc = e.finish().unwrap(); let request = srv.post() - .header(header::CONTENT_ENCODING, "gzip") + .header(header::http::CONTENT_ENCODING, "gzip") .body(enc.clone()).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -570,7 +570,7 @@ fn test_reading_deflate_encoding() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -581,7 +581,7 @@ fn test_reading_deflate_encoding() { // client request let request = srv.post() - .header(header::CONTENT_ENCODING, "deflate") + .header(header::http::CONTENT_ENCODING, "deflate") .body(enc).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -599,7 +599,7 @@ fn test_reading_deflate_encoding_large() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -610,7 +610,7 @@ fn test_reading_deflate_encoding_large() { // client request let request = srv.post() - .header(header::CONTENT_ENCODING, "deflate") + .header(header::http::CONTENT_ENCODING, "deflate") .body(enc).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -632,7 +632,7 @@ fn test_reading_deflate_encoding_large_random() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -643,7 +643,7 @@ fn test_reading_deflate_encoding_large_random() { // client request let request = srv.post() - .header(header::CONTENT_ENCODING, "deflate") + .header(header::http::CONTENT_ENCODING, "deflate") .body(enc).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -662,7 +662,7 @@ fn test_brotli_encoding() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -673,7 +673,7 @@ fn test_brotli_encoding() { // client request let request = srv.post() - .header(header::CONTENT_ENCODING, "br") + .header(header::http::CONTENT_ENCODING, "br") .body(enc).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success()); @@ -692,7 +692,7 @@ fn test_brotli_encoding_large() { .and_then(|bytes: Bytes| { Ok(httpcodes::HTTPOk .build() - .content_encoding(headers::ContentEncoding::Identity) + .content_encoding(header::ContentEncoding::Identity) .body(bytes)) }).responder()} )); @@ -703,7 +703,7 @@ fn test_brotli_encoding_large() { // client request let request = srv.post() - .header(header::CONTENT_ENCODING, "br") + .header(header::http::CONTENT_ENCODING, "br") .body(enc).unwrap(); let response = srv.execute(request.send()).unwrap(); assert!(response.status().is_success());