* 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>
* implemented function which returns full uir
* changes added into the changelog
* added test funtion for full_uri method
* refactor: rename to full_url
---------
Co-authored-by: Rob Ede <robjtede@icloud.com>
* Strip non-address characters from Forwarded for=
This is something of a followup to #2528, which asked for port information to not be included in when it was taken from the local socket.
The header's element may optionally contain port information (https://datatracker.ietf.org/doc/html/rfc7239#section-6).
However, as I understand it, is *supposed* to only contain an IP address, without port (per #2528).
This PR corrects that discrepancy, making it easier to parse the result of this method in application code.
There should not be any compatibility concerns, as anyone parsing the output of would already need to handle both port and portless cases anyway.
* Update CHANGES.md
---------
Co-authored-by: Rob Ede <robjtede@icloud.com>
* feat: add .customize().add_cookie()
* docs: added cookie hint
* fix: added unwrap to test of add_cookie()
* docs: added changelog entry for .customize().add_cookie()
* chore: make append_header infallible
* docs: update changelog
---------
Co-authored-by: Rob Ede <robjtede@icloud.com>
* 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>
* 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
---------
Co-authored-by: Rob Ede <robjtede@icloud.com>
* - Add `unicode` feature to switch between `regex` and `regex-lite`
as a trade-off between full unicode support and binary size.
* Update CHANGES.md
* Update CHANGES.md
* refactor: move regexset code selection to own module
* docs: add docs within RegexSet module
* chore: restore manifests
* test: ensure all actix-router codepaths are tested
---------
Co-authored-by: Rob Ede <robjtede@icloud.com>
* fix: content type required flag
* clarify comments for invalid json mime type
* remove pr reference
---------
Co-authored-by: Rob Ede <robjtede@icloud.com>
* Implement Default and Deserialize for Data
* FMT
* Change Log
* tweak changelog
* chore: whitespace
---------
Co-authored-by: Rob Ede <robjtede@icloud.com>
* misc: add temporary nix file
* Add test to check content type image/*
* misc: add unit test for expected behaviour jpeg
* feat(compress): add compress function to middleware
* feat(compress): use response content type to decide compress
* feat(compress): give more control to the user
* misc: improve default compress function
* add Compress::with_predicate
* remove predicate options
* assert auto traits on Compress
* fix changelog
---------
Co-authored-by: William R. Arellano <arellanowr@gmail.com>