Added get_url_root_parent helper to Request.

This commit is contained in:
Relintai 2021-11-01 20:57:43 +01:00
parent 1a09dd13b0
commit e7d4772ef3
2 changed files with 12 additions and 0 deletions

View File

@ -202,6 +202,17 @@ void Request::push_path() {
_path_stack_pointer += 1;
}
String Request::get_url_root_parent() const {
String path = "/";
for (uint32_t i = 0; i < _path_stack_pointer - 1; ++i) {
path += _path_stack[i];
path += "/";
}
return path;
}
String Request::get_url_root() const {
String path = "/";

View File

@ -75,6 +75,7 @@ public:
void pop_path();
void push_path();
String get_url_root_parent() const;
String get_url_root() const;
String get_url_site() const;