mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-22 21:55:10 +02:00
Compare commits
3 Commits
http-v3.9.
...
awc-v3.5.1
Author | SHA1 | Date | |
---|---|---|---|
|
70e3758ecc | ||
|
5ad92c0062 | ||
|
e0918fb179 |
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 4.9.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Add `middleware::from_fn()` helper.
|
- Add `middleware::from_fn()` helper.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-web"
|
name = "actix-web"
|
||||||
version = "4.8.0"
|
version = "4.9.0"
|
||||||
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
|
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
|
||||||
authors = [
|
authors = [
|
||||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||||
|
@@ -8,10 +8,10 @@
|
|||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
|
|
||||||
[](https://crates.io/crates/actix-web)
|
[](https://crates.io/crates/actix-web)
|
||||||
[](https://docs.rs/actix-web/4.8.0)
|
[](https://docs.rs/actix-web/4.9.0)
|
||||||

|

|
||||||

|

|
||||||
[](https://deps.rs/crate/actix-web/4.8.0)
|
[](https://deps.rs/crate/actix-web/4.9.0)
|
||||||
<br />
|
<br />
|
||||||
[](https://github.com/actix/actix-web/actions/workflows/ci.yml)
|
[](https://github.com/actix/actix-web/actions/workflows/ci.yml)
|
||||||
[](https://codecov.io/gh/actix/actix-web)
|
[](https://codecov.io/gh/actix/actix-web)
|
||||||
|
@@ -2,11 +2,15 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 3.5.1
|
||||||
|
|
||||||
|
- Fix WebSocket `Host` request header value when using a non-default port.
|
||||||
|
|
||||||
## 3.5.0
|
## 3.5.0
|
||||||
|
|
||||||
- Add `rustls-0_23`, `rustls-0_23-webpki-roots`, and `rustls-0_23-native-roots` crate features.
|
- Add `rustls-0_23`, `rustls-0_23-webpki-roots`, and `rustls-0_23-native-roots` crate features.
|
||||||
- Add `awc::Connector::rustls_0_23()` constructor.
|
- Add `awc::Connector::rustls_0_23()` constructor.
|
||||||
- Fix `rustls-0_22-native-roots` root store lookup
|
- Fix `rustls-0_22-native-roots` root store lookup.
|
||||||
- Update `brotli` dependency to `6`.
|
- Update `brotli` dependency to `6`.
|
||||||
- Minimum supported Rust version (MSRV) is now 1.72.
|
- Minimum supported Rust version (MSRV) is now 1.72.
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "awc"
|
name = "awc"
|
||||||
version = "3.5.0"
|
version = "3.5.1"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Async HTTP and WebSocket client library"
|
description = "Async HTTP and WebSocket client library"
|
||||||
keywords = ["actix", "http", "framework", "async", "web"]
|
keywords = ["actix", "http", "framework", "async", "web"]
|
||||||
|
@@ -5,9 +5,9 @@
|
|||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
|
|
||||||
[](https://crates.io/crates/awc)
|
[](https://crates.io/crates/awc)
|
||||||
[](https://docs.rs/awc/3.5.0)
|
[](https://docs.rs/awc/3.5.1)
|
||||||

|

|
||||||
[](https://deps.rs/crate/awc/3.5.0)
|
[](https://deps.rs/crate/awc/3.5.1)
|
||||||
[](https://discord.gg/NWpN5mmg3x)
|
[](https://discord.gg/NWpN5mmg3x)
|
||||||
|
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
|
@@ -257,8 +257,9 @@ impl WebsocketsRequest {
|
|||||||
return Err(e.into());
|
return Err(e.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate uri
|
// validate URI
|
||||||
let uri = &self.head.uri;
|
let uri = &self.head.uri;
|
||||||
|
|
||||||
if uri.host().is_none() {
|
if uri.host().is_none() {
|
||||||
return Err(InvalidUrl::MissingHost.into());
|
return Err(InvalidUrl::MissingHost.into());
|
||||||
} else if uri.scheme().is_none() {
|
} else if uri.scheme().is_none() {
|
||||||
@@ -273,9 +274,12 @@ impl WebsocketsRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !self.head.headers.contains_key(header::HOST) {
|
if !self.head.headers.contains_key(header::HOST) {
|
||||||
|
let hostname = uri.host().unwrap();
|
||||||
|
let port = uri.port();
|
||||||
|
|
||||||
self.head.headers.insert(
|
self.head.headers.insert(
|
||||||
header::HOST,
|
header::HOST,
|
||||||
HeaderValue::from_str(uri.host().unwrap()).unwrap(),
|
HeaderValue::from_str(&Host { hostname, port }.to_string()).unwrap(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -434,6 +438,25 @@ impl fmt::Debug for WebsocketsRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Formatter for host (hostname+port) header values.
|
||||||
|
struct Host<'a> {
|
||||||
|
hostname: &'a str,
|
||||||
|
port: Option<http::uri::Port<&'a str>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> fmt::Display for Host<'a> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.write_str(self.hostname)?;
|
||||||
|
|
||||||
|
if let Some(port) = &self.port {
|
||||||
|
f.write_str(":")?;
|
||||||
|
f.write_str(port.as_str())?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
Reference in New Issue
Block a user