How to specify route for URL ending with "/ip=1.2.3.4"? #2041
Unanswered
crusty-dave
asked this question in
General
Replies: 1 comment 1 reply
-
I figured out that I can at least use a scope and set a default_resource() handler, that will allow me to manually parse the URI. At this point, I would still like to know if there is a way to have actix-web 0.7 parse the address portion (/ip=address)? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to support some legacy code that incorrectly specified the URI.
Note that I am still using actix-web 0.7 in this project.
In looking at the following:
https://actix.rs/docs/url-dispatch/
I thought I might be able to use a "tail" style regex, but I still get a 404:
r"/query/user/{tail:.*}"
I can see the path via logging in middleware, I just need to figure out a way to specify a route to use a handler instead of triggering the default handler that returns 404.
I know that in actix-web 2.0 and later, I could probably override the default handler, but is there a way to handle this in 0.7?
Note that the full path is also including a query string at the end. (i.e. xxx/ip=1.2.3.4?q1=foo&q2=bar
Thanks in advance,
-Dave
Beta Was this translation helpful? Give feedback.
All reactions