Commit Graph

20 Commits

Author SHA1 Message Date
Yuki Okushi b6f93ba9a0
fix(http,web): correctly drop `web::Data` on graceful shutdown (#4033) 2026-04-25 15:35:32 +09:00
Romain Roffé 4fcde646b9
fix(windows): enable dual-stack IPv6 sockets by default (#3988)
* fix(windows): enable dual-stack IPv6 sockets by default

On Windows, IPV6_V6ONLY defaults to true, so binding to [::] only
accepts IPv6 connections. Set it to false so that IPv6 listeners also
accept IPv4 traffic, matching the default Linux behavior.

* chore: add test

---------

Co-authored-by: Romain Roffé <r2@kyber.media>
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2026-03-29 10:21:46 +00:00
Yuki Okushi d66f89b7b6
feat(http,web): add config for `TCP_NODELAY` (#3918) 2026-02-12 05:57:02 +09:00
Guillermo Céspedes Tabárez 84ddfe7b97
feat(web): initial support for route and HTTP method introspection (#3594)
* feat(resources-introspection): add support for resource metadata retrieval

* misc: remove debug print

* style: cargo fmt

* fix(guards): replace take_guards with get_guards to prevent guard removal and fix test failures

* ci: downgrade for msrv litemap to version 0.7.4 in justfile

* chore: update changelog and fix docs for CI

* ci: downgrade for msrv zerofrom to version 0.1.5 in justfile

* refactor: improve thread safety and add unit tests for introspection process

* fix(introspection): add conditional arbiter creation for io-uring support

* fix(introspection): add conditional arbiter creation for io-uring support

* refactor(introspection): add GuardDetail enum and remove downcast_ref usage

- Added `GuardDetail` enum to encapsulate various introspection details of a guard.
- Refactored `HttpMethodsExtractor` implementation to use `GuardDetail` instead of `downcast_ref`.

* refactor(introspection): add GuardDetail enum and remove downcast_ref usage

- Added `GuardDetail` enum to encapsulate various introspection details of a guard.
- Refactored `HttpMethodsExtractor` implementation to use `GuardDetail` instead of `downcast_ref`.

* feat(introspection): rename feature from `resources-introspection` to `experimental-introspection`
- Refactored introspection logic.
- Enhanced route introspection to register HTTP methods and guard names.
- Added example for testing the experimental introspection feature.

* fix Cargo.lock

* feat(introspection): enhance introspection feature with detailed route registration and full path tracking

* optimize debug log and apply clippy/fmt suggestions

* feat(introspection): enhance introspection handlers for JSON and plain text responses

* feat(introspection): implement experimental introspection feature with multiple App instances

* Enhance experimental introspection feature with detailed route reporting

- Introduced a new `experimental-introspection` feature that provides comprehensive reports on configured routes, including paths, methods, guards, and resource metadata.
- Added support for reachability hints to identify shadowed or conflicting routes.
- Implemented new endpoints for external resources reporting.
- Updated existing route registration to include detailed introspection data.
- Enhanced guard implementations to provide introspection details.

* Refactor route registration to use RouteInfo struct & cargo clippy

* put all the items behind feature gate

* tweak

* fmt

---------

Co-authored-by: Guillermo Céspedes Tabárez <gcespedes@prexcard.com>
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2026-02-11 06:25:39 +00:00
Yuki Okushi 41f99b0ddd
fix(*): replace rustls-pemfile (#3855) 2025-12-12 08:11:24 +09:00
Yuki Okushi aeb42486af
fix(actix-web): improve streaming response behavior for Content-Length and Content-Type (#3737)
- Set default Content-Type to application/octet-stream for streaming responses
- Respect Content-Length header by automatically calling `no_chunking()` when set
- Resolves issue where Content-Length was ignored in streaming responses

Fixes #2306

---------

Co-authored-by: Yinuo Deng <i@dyn.im>
2025-08-23 12:23:57 +09:00
dependabot[bot] 66e2afe306
build(deps): update rand requirement from 0.8 to 0.9 (#3564)
* build(deps): update rand requirement from 0.8 to 0.9

Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.0...0.9.0)

---
updated-dependencies:
- dependency-name: rand
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: fix rand upgrade

* chore: address clippy lint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
2025-02-09 02:39:22 +00:00
Bryan A. Jones 1c4e265a70
Set `SO_REUSEADDR` only non-Windows platforms (#3473)
* Fix: Per discussion in #2958, set `SO_REUSEADDR` only non-Windows platforms.

Add: Tests confirming that only a single webserver instance may
bind to a given address.

* Clean: Lint.

* Clean: another guess at making the formatter happy.

* Clean: More cargo fmt fun. (Running cargo fmt locally doesn't help.)

---------

Co-authored-by: Bryan A. Jones <bjones1@users.noreply.github.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
2024-10-01 07:08:34 +00:00
Rob Ede e8262da138
chore: update rcgen to 0.13 2024-05-19 10:12:32 +01:00
asonix 2e63ff5928
actix-web: Add rustls 0.23 (#3363)
* Fix type confusion in some scenarios

When the feature for rustls 0.22 is enabled, and rustls 0.23 is also
present in a project, there suddently exist multiple paths for errors
when building middleware chains due to the use of two consecutive `?`
operators without specifying the intermediate error type.

This commit addresses the issue by removing the first `?`, so that the
first error type will always be known, and the second `?` always has a
well defined implementation.

* Add CHANGES entry about type confusion

* actix-http: add rustls 0.23 support

* actix-http: update ws example, tests for rustls 0.23

* actix-http: add rustls 0.23 to changelog

* Update comments to mention 0.23 instead of 0.22

* awc: add rustls 0.23 support

This also fixes certificate lookup when native-roots is enabled for rustls 0.22.

* awc: update changelog for rustls 0.23

* awc: Add base rustls-0_23 feature without roots to better enable custom config

* actix-test: add rustls-0.23

* actix-test: add rustls 0.23 to changelog

* awc: update changelog with rustls 0.23 tweaks

* actix-web: add rustls 0.23

* Add rustls-0_23 to CI

* Update tls_rustls.rs

* review nits

* review nits part 2

* fix doc test

---------

Co-authored-by: Rob Ede <robjtede@icloud.com>
2024-05-18 19:05:58 +00:00
Rob Ede e518170a30
test: fix test_server 2024-02-04 03:40:58 +00:00
Rob Ede f5f6132f94
test: update rustls for test_server 2024-02-04 03:30:16 +00:00
Rob Ede 2125aca2c5
Rustls v0.22 support (#3275) 2024-02-03 23:55:01 +00:00
Rob Ede 5e5e5d8315
chore: remove allow(uninlined_format_args) 2023-12-16 10:33:00 +00:00
Amit Upadhyay c0615f28ed
Make compression middleware prefer brotli over zstd over gzip (#3189)
* AcceptEncoding.preference() prefers brotli > zstd > gzip

* AcceptEncoding.{ranked,negotiate}() prefers brotli > zstd > gzip

* changelog entry

* use browser-realistic encoding tests

* fix choosing identity when q=0

---------

Co-authored-by: Rob Ede <robjtede@icloud.com>
2023-11-19 18:54:08 +00:00
Rob Ede 905c30af86
Actix Web Rustls v0.21 support (#3116) 2023-08-29 01:11:11 +01:00
Rob Ede 79a38e0628
apply standard formatting 2023-07-17 02:38:12 +01:00
Rob Ede 6f0a6bd1bb
address clippy lints
For intrepid commit message readers:
The choice to add allows for the inlined format args lint instead of actually
inlining them is not very clear because our actual real world MSRV is not clear.
We currently claim 1.60 is our MSRV but this is mainly due to dependencies. I'm
fairly sure that we could support < 1.58 if those deps are outdated in a users
lockfile. We'll remove these allows again at some point soon.
2023-01-01 20:56:34 +00:00
Rob Ede 45592b37b6
add `Route::wrap` (#2725)
* add `Route::wrap`

* add tests

* fix clippy

* fix doctests
2022-04-23 21:01:55 +01:00
Rob Ede bcdde1d4ea
move actix-web to own dir 2022-02-01 00:30:41 +00:00