Repository navigation
fix(web): expose AppConfig constructor for custom servers - #4243
akasakariko wants to merge 4 commits into
Conversation
|
I'm interested in addressing the issue that this fixes so I'll check this out once you've undrafted and think it's ready. |
…ic-constructor # Conflicts: # actix-web/CHANGES.md
|
Closing and reopening as a non-draft PR. I wasn't able to mark this draft ready for review (GitHub returns a permission error for the author on this fork PR), so the replacement PR will be opened ready for review. Same branch and commits. |
|
Re-closing to open a replacement non-draft PR (author cannot undraft this one; CLI create also hit a permission error, so opening via the web UI next). |
|
Marked ready for review. Earlier undraft attempts failed because this account had already hit the repository open (non-draft) PR limit; temporarily converting #4238 back to draft freed the slot. |
|
@robjtede Friendly ping — this is ready for review now and CI is green. Let me know if you'd like any changes. |
|
Updated in 72957b7
ValidationLocal checks passed on macOS with stable Rust and MSRV 1.88 Commands and results
Cargo reported the existing non-fatal Remaining CI blockerGitHub checks finished with 15 passed, 1 failed, and 1 skipped
|
PR Type
Bug Fix
PR Checklist
Overview
Custom servers built with
actix_server::Servercannot currently construct a supportedAppConfigwith their actual listener metadata. Falling back toAppConfig::default()can give requests the wrong local address, hostname, and scheme, and produce incorrect generated URLs.Expose and document the existing
AppConfig::newconstructor, and update the low-level server example to derive its configuration from the bound listener. This is an additive API change; existing default values and the hidden test constructor are preserved.Regression tests cover request configuration, scheme/host fallbacks and URL generation, header/URI precedence, and two listeners sharing one worker.
Closes #3180.
Validation
The new external-crate regression tests fail before the change with
E0624because the constructor is private, and pass after the change.cargo +stable test -p actix-web --lib --tests --all-features --locked: 479 passed, 1 existing ignored test.cargo +stable test -p actix-web --doc --locked: 193 passed, 7 existing ignored doctests.actix-http'sactix-webexample build passed.actix-webandactix-http, rustdoc with warnings denied, Rustfmt, and changelog formatting checks passed.