Getting full path in handler
AngelicosPhosphoros opened this issue · comments
Hi, guys.
I want to create multilingual site with path-based language handling.
Consider we have 3 paths:
/docs/published/
/en/docs/published/
/ru/docs/published/
Request with first uri must be redirected to one of other variants, and it is easy to implement.
But the other thing that I want the button for language switch on page and hints for search engines about localized version. So in english page must be link to russian version and vice versa.
So I need to get extra part of the any page after /en
и /ru
.
How it can be made? I tried borrow helpers::http::request::path::RequestPathSegments
from state, but all it's getter methods are inaccessible :(
Oh, I found getting Uri in examples: https://github.com/gotham-rs/gotham/blob/master/examples/handlers/request_data/src/main.rs
Sounds like you found what you were looking for. Feel free to reopen if you still need help.