-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path parsing doesn't handle :
nor rfc3986 sub-delims
#2128
Comments
They currently do not pass, but should be addressed when tokio-rs#2128 is fixed.
Duplicate of #1452, blocked on ibraheemdev/matchit#23. |
:
, a valid pchar
in segment
:
nor rfc3986 sub-delims
Thanks for the link to the
|
Yep. All that is on matchit. Axum can't do anything about that. |
I made a PR for kris@slate matchit % git log -2
commit 47ec320f6a8a51fcb39af66b6d658ce443586dd6 (HEAD -> sub-delims-test, origin/sub-delims-test)
Author: Kristopher Wuollett <[email protected]>
Date: Fri Jul 28 13:24:52 2023 -0500
Add sub-delim path tests
Excluded `*` since it is known to not be supported yet, see #23.
commit 617e7450c62dcb1fc28ebd3ae5920e83da3a53e1 (upstream/master, origin/master, origin/HEAD, master)
Author: Ibraheem Ahmed <[email protected]>
Date: Mon May 22 20:38:18 2023 -0400
update wildcard docs
kris@slate matchit % cargo test --all-targets --all-features
Finished test [unoptimized + debuginfo] target(s) in 0.21s
Running unittests src/lib.rs (target/debug/deps/matchit-167ba8d0bd0fe61e)
running 4 tests
test params::tests::ignore_array_default ... ok
test params::tests::no_alloc ... ok
test params::tests::heap_alloc ... ok
test params::tests::stack_alloc ... ok
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/tree.rs (target/debug/deps/tree-94a600691b508ccd)
running 27 tests
test catchall_root_conflict ... ok
test backtracking_tsr ... ok
test catchall_static_overlap1 ... ok
test catchall_static_overlap2 ... ok
test catchall_off_by_one ... ok
test catchall_static_overlap3 ... ok
test blog ... ok
test child_conflict ... ok
test catchall_static_overlap ... ok
test double_params ... ok
test duplicates ... ok
test double_overlap_tsr ... ok
test invalid_catchall ... ok
test invalid_catchall2 ... ok
test basic ... ok
test double_overlap ... ok
test issue_12 ... ok
test issue_22 ... ok
test root_tsr ... ok
test more_conflicts ... ok
test root_tsr_static ... ok
test root_tsr_wildcard ... ok
test same_len ... ok
test unnamed_param ... ok
test tsr ... ok
test wildcard_conflict ... ok
test wildcard ... ok
test result: ok. 27 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running benches/bench.rs (target/debug/deps/bench-c799fb547ed938ff)
WARNING: HTML report generation will become a non-default optional feature in Criterion.rs 0.4.0.
This feature is being moved to cargo-criterion (https://github.com/bheisler/cargo-criterion) and will be optional in a future version of Criterion.rs. To silence this warning, either switch to cargo-criterion or enable the 'html_reports' feature in your Cargo.toml.
Testing Compare Routers/matchit
Success
Testing Compare Routers/path-tree
Success
Testing Compare Routers/gonzales
Success
Testing Compare Routers/actix
Success
Testing Compare Routers/regex
Success
Testing Compare Routers/route-recognizer
Success
Testing Compare Routers/routefinder
Success
Running unittests examples/hyper.rs (target/debug/examples/hyper-543ff5f9354bfbb4)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s |
Are you saying it does work in matchit but not axum? |
Probably? Just from the tests I through together it looks like something like Not absolutely sure since I threw together those tests fairly quickly without reading much code. |
This would be great if fixable, as Google API guidelines recommend paths such as |
The closest issue I could find is #261.
Bug Report
Version
Platform
kris@slate axum % uname -a Darwin slate.localdomain 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
Crates
Using git commit of
axum
repo at64c566cd1c7ff9458a69de2274ae4833cda82666
.Description
I tried to capture a path segment in a URL that had another path segment with an embedded
:
in its name. According to RFC 3986:Therefore the path segment capture should not process a segment like
a:b
in/:param/a:b/something
, andaxum
should provide a way to escape:
if it is the leadingpchar
in asegment
. It seems likeaxum
isn't percent decoding the path segments as well?I tried this code:
Instead, this happened:
Notes
I believe the above should be supported, but it's the first time I'm encountering a URL with a
:
in a path segment, so not absolutely sure. However, I do not expect to have time to write a PR to fix at the moment if this should be fixed.If this is supported, then perhaps some details are missing in the docs and/or test cases.
The text was updated successfully, but these errors were encountered: