mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-03 01:19:38 +01:00
Tweak WebNode::get_full_uri() to give back the output what you'd normally assume when the uri segment is "/" under a WebRoot.
This commit is contained in:
parent
956bc0e9a0
commit
225bfef3e6
@ -58,6 +58,15 @@ void WebNode::set_uri_segment(const String &val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String WebNode::get_full_uri(const bool slash_at_the_end) {
|
String WebNode::get_full_uri(const bool slash_at_the_end) {
|
||||||
|
// Special case for WebRoots for ease of use
|
||||||
|
if (_uri_segment == "/") {
|
||||||
|
if (slash_at_the_end) {
|
||||||
|
return _uri_segment;
|
||||||
|
} else {
|
||||||
|
return String();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (slash_at_the_end) {
|
if (slash_at_the_end) {
|
||||||
return get_full_uri_parent(true) + _uri_segment + "/";
|
return get_full_uri_parent(true) + _uri_segment + "/";
|
||||||
} else {
|
} else {
|
||||||
|
@ -140,10 +140,6 @@ void BrowsableFolderServeWebPage::render_dir_page(const String &dir_uri, const V
|
|||||||
|
|
||||||
String uri = get_full_uri(false);
|
String uri = get_full_uri(false);
|
||||||
|
|
||||||
if (uri == "/") {
|
|
||||||
uri = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
b.div("file_list");
|
b.div("file_list");
|
||||||
{
|
{
|
||||||
if (!top_level) {
|
if (!top_level) {
|
||||||
|
Loading…
Reference in New Issue
Block a user