chore: upgrade to ntex 1.1 (#12)

This commit is contained in:
leone 2024-02-28 12:21:46 +01:00 committed by GitHub
parent 7b8a385565
commit b72566656a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 18 additions and 18 deletions

View file

@ -4,7 +4,7 @@
<p> <p>
[![Build Status](https://github.com/ntex-rs/ntex-extras/workflows/CI%20(Linux)/badge.svg)](https://travis-ci.org/ntex-rs/ntex) [![Build Status](https://github.com/ntex-rs/ntex-extras/workflows/CI%20(Linux)/badge.svg)](https://travis-ci.org/ntex-rs/ntex)
[![Version](https://img.shields.io/badge/rustc-1.65+-lightgray.svg)](https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html) [![Version](https://img.shields.io/badge/rustc-1.75+-lightgray.svg)](https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html)
[![codecov](https://codecov.io/gh/ntex-rs/ntex-extras/branch/master/graph/badge.svg)](https://codecov.io/gh/ntex-rs/ntex-extras) [![codecov](https://codecov.io/gh/ntex-rs/ntex-extras/branch/master/graph/badge.svg)](https://codecov.io/gh/ntex-rs/ntex-extras)
</p> </p>

View file

@ -16,9 +16,9 @@ name = "ntex_cors"
path = "src/lib.rs" path = "src/lib.rs"
[dependencies] [dependencies]
ntex = "1.0" ntex = "1.1"
derive_more = "0.99" derive_more = "0.99"
futures = "0.3" futures = "0.3"
[dev-dependencies] [dev-dependencies]
ntex = { version = "1.0", features=["tokio"] } ntex = { version = "1.1", features=["tokio"] }

View file

@ -18,7 +18,7 @@ name = "ntex_files"
path = "src/lib.rs" path = "src/lib.rs"
[dependencies] [dependencies]
ntex = "1.0" ntex = "1.1"
ntex-http = "0.1.12" ntex-http = "0.1.12"
bitflags = "2.1" bitflags = "2.1"
futures = "0.3" futures = "0.3"
@ -34,4 +34,4 @@ language-tags = "0.3"
httpdate = "1.0" httpdate = "1.0"
[dev-dependencies] [dev-dependencies]
ntex = { version = "1.0", features = ["tokio", "openssl", "compress"] } ntex = { version = "1.1", features = ["tokio", "openssl", "compress"] }

View file

@ -21,7 +21,7 @@ default = ["cookie-policy"]
cookie-policy = ["cookie/secure", "ntex/cookie"] cookie-policy = ["cookie/secure", "ntex/cookie"]
[dependencies] [dependencies]
ntex = "1.0" ntex = "1.1"
futures = "0.3" futures = "0.3"
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
@ -30,4 +30,4 @@ cookie = { version = "0.18", features = ["private"] }
time = { version = "0.3", default-features = false, features = ["std"] } time = { version = "0.3", default-features = false, features = ["std"] }
[dev-dependencies] [dev-dependencies]
ntex = { version = "1.0", features=["tokio"] } ntex = { version = "1.1", features=["tokio"] }

View file

@ -16,7 +16,7 @@ name = "ntex_multipart"
path = "src/lib.rs" path = "src/lib.rs"
[dependencies] [dependencies]
ntex = "1.0" ntex = "1.1"
derive_more = "0.99" derive_more = "0.99"
httparse = "1.3" httparse = "1.3"
futures = "0.3" futures = "0.3"
@ -25,4 +25,4 @@ mime = "0.3"
twoway = "0.2" twoway = "0.2"
[dev-dependencies] [dev-dependencies]
ntex = { version = "1.0", features=["tokio"] } ntex = { version = "1.1", features=["tokio"] }

View file

@ -1,6 +1,6 @@
//! Error and Result module //! Error and Result module
use derive_more::{Display, From}; use derive_more::{Display, From};
use ntex::http::error::{ParseError, PayloadError}; use ntex::http::error::{DecodeError, PayloadError};
use ntex::http::StatusCode; use ntex::http::StatusCode;
use ntex::web::error::{DefaultError, WebResponseError}; use ntex::web::error::{DefaultError, WebResponseError};
@ -24,7 +24,7 @@ pub enum MultipartError {
Incomplete, Incomplete,
/// Error during field parsing /// Error during field parsing
#[display(fmt = "{}", _0)] #[display(fmt = "{}", _0)]
Parse(ParseError), Decode(DecodeError),
/// Payload error /// Payload error
#[display(fmt = "{}", _0)] #[display(fmt = "{}", _0)]
Payload(PayloadError), Payload(PayloadError),

View file

@ -4,7 +4,7 @@ use std::task::{Context, Poll};
use std::{cmp, convert::TryFrom, fmt, marker::PhantomData, pin::Pin, rc::Rc}; use std::{cmp, convert::TryFrom, fmt, marker::PhantomData, pin::Pin, rc::Rc};
use futures::stream::{LocalBoxStream, Stream, StreamExt}; use futures::stream::{LocalBoxStream, Stream, StreamExt};
use ntex::http::error::{ParseError, PayloadError}; use ntex::http::error::{DecodeError, PayloadError};
use ntex::http::header::{self, HeaderMap, HeaderName, HeaderValue}; use ntex::http::header::{self, HeaderMap, HeaderName, HeaderValue};
use ntex::task::LocalWaker; use ntex::task::LocalWaker;
use ntex::util::{Bytes, BytesMut}; use ntex::util::{Bytes, BytesMut};
@ -134,16 +134,16 @@ impl InnerMultipart {
if let Ok(value) = HeaderValue::try_from(h.value) { if let Ok(value) = HeaderValue::try_from(h.value) {
headers.append(name, value); headers.append(name, value);
} else { } else {
return Err(ParseError::Header.into()); return Err(DecodeError::Header.into());
} }
} else { } else {
return Err(ParseError::Header.into()); return Err(DecodeError::Header.into());
} }
} }
Ok(Some(headers)) Ok(Some(headers))
} }
Ok(httparse::Status::Partial) => Err(ParseError::Header.into()), Ok(httparse::Status::Partial) => Err(DecodeError::Header.into()),
Err(err) => Err(ParseError::from(err).into()), Err(err) => Err(DecodeError::from(err).into()),
} }
} }
} }

View file

@ -22,7 +22,7 @@ default = ["cookie-session"]
cookie-session = ["cookie/secure", "ntex/cookie"] cookie-session = ["cookie/secure", "ntex/cookie"]
[dependencies] [dependencies]
ntex = "1.0" ntex = "1.1"
cookie = "0.18" cookie = "0.18"
derive_more = "0.99" derive_more = "0.99"
futures = "0.3" futures = "0.3"
@ -31,4 +31,4 @@ serde_json = "1.0"
time = { version = "0.3", default-features = false, features = ["std"] } time = { version = "0.3", default-features = false, features = ["std"] }
[dev-dependencies] [dev-dependencies]
ntex = { version = "1.0", features=["tokio"] } ntex = { version = "1.1", features=["tokio"] }