gotham-rs / gotham

A flexible web framework that promotes stability, safety, security and speed.

Home Page:https://gotham.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 :(

commented

Sounds like you found what you were looking for. Feel free to reopen if you still need help.