1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-22 13:45:13 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Rob Ede
a7c5366503 Merge branch 'master' into ci-semver-check-on-label 2024-08-10 03:17:23 +01:00
Rob Ede
270bbf1906 ci: check semver on labelling PRs 2023-12-16 11:00:29 +00:00
8 changed files with 58 additions and 38 deletions

49
.github/workflows/semver.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Semver
on:
pull_request:
types: [labeled]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.label.name }}
cancel-in-progress: true
jobs:
check-semver-patch:
name: Check semver (patch)
runs-on: ubuntu-latest
if: github.event.label.name == 'B-semver-patch'
steps:
- uses: actions/checkout@v4
- name: Check semver (patch)
uses: obi1kenobi/cargo-semver-checks-action@v2.1
with:
release-type: patch
check-semver-minor:
name: Check semver (minor)
runs-on: ubuntu-latest
if: github.event.label.name == 'B-semver-minor'
steps:
- uses: actions/checkout@v4
- name: Check semver (minor)
uses: obi1kenobi/cargo-semver-checks-action@v2.1
with:
release-type: minor
check-semver-major:
name: Check semver (major)
runs-on: ubuntu-latest
if: github.event.label.name == 'B-semver-major'
steps:
- uses: actions/checkout@v4
- name: Check semver (major)
uses: obi1kenobi/cargo-semver-checks-action@v2.1
with:
release-type: major

View File

@@ -2,8 +2,6 @@
## Unreleased
## 4.9.0
### Added
- Add `middleware::from_fn()` helper.

View File

@@ -1,6 +1,6 @@
[package]
name = "actix-web"
version = "4.9.0"
version = "4.8.0"
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
authors = [
"Nikolay Kim <fafhrd91@gmail.com>",

View File

@@ -8,10 +8,10 @@
<!-- prettier-ignore-start -->
[![crates.io](https://img.shields.io/crates/v/actix-web?label=latest)](https://crates.io/crates/actix-web)
[![Documentation](https://docs.rs/actix-web/badge.svg?version=4.9.0)](https://docs.rs/actix-web/4.9.0)
[![Documentation](https://docs.rs/actix-web/badge.svg?version=4.8.0)](https://docs.rs/actix-web/4.8.0)
![MSRV](https://img.shields.io/badge/rustc-1.72+-ab6000.svg)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web.svg)
[![Dependency Status](https://deps.rs/crate/actix-web/4.9.0/status.svg)](https://deps.rs/crate/actix-web/4.9.0)
[![Dependency Status](https://deps.rs/crate/actix-web/4.8.0/status.svg)](https://deps.rs/crate/actix-web/4.8.0)
<br />
[![CI](https://github.com/actix/actix-web/actions/workflows/ci.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web)

View File

@@ -2,15 +2,11 @@
## Unreleased
## 3.5.1
- Fix WebSocket `Host` request header value when using a non-default port.
## 3.5.0
- Add `rustls-0_23`, `rustls-0_23-webpki-roots`, and `rustls-0_23-native-roots` crate features.
- 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`.
- Minimum supported Rust version (MSRV) is now 1.72.

View File

@@ -1,6 +1,6 @@
[package]
name = "awc"
version = "3.5.1"
version = "3.5.0"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Async HTTP and WebSocket client library"
keywords = ["actix", "http", "framework", "async", "web"]

View File

@@ -5,9 +5,9 @@
<!-- prettier-ignore-start -->
[![crates.io](https://img.shields.io/crates/v/awc?label=latest)](https://crates.io/crates/awc)
[![Documentation](https://docs.rs/awc/badge.svg?version=3.5.1)](https://docs.rs/awc/3.5.1)
[![Documentation](https://docs.rs/awc/badge.svg?version=3.5.0)](https://docs.rs/awc/3.5.0)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/awc)
[![Dependency Status](https://deps.rs/crate/awc/3.5.1/status.svg)](https://deps.rs/crate/awc/3.5.1)
[![Dependency Status](https://deps.rs/crate/awc/3.5.0/status.svg)](https://deps.rs/crate/awc/3.5.0)
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
<!-- prettier-ignore-end -->

View File

@@ -257,9 +257,8 @@ impl WebsocketsRequest {
return Err(e.into());
}
// validate URI
// validate uri
let uri = &self.head.uri;
if uri.host().is_none() {
return Err(InvalidUrl::MissingHost.into());
} else if uri.scheme().is_none() {
@@ -274,12 +273,9 @@ impl WebsocketsRequest {
}
if !self.head.headers.contains_key(header::HOST) {
let hostname = uri.host().unwrap();
let port = uri.port();
self.head.headers.insert(
header::HOST,
HeaderValue::from_str(&Host { hostname, port }.to_string()).unwrap(),
HeaderValue::from_str(uri.host().unwrap()).unwrap(),
);
}
@@ -438,25 +434,6 @@ 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)]
mod tests {
use super::*;