From df6186524adc2950d0b7868744386ca5c98d4495 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 21 Dec 2022 15:12:53 +0100 Subject: [PATCH] Ensure a '/' in between the host, and the url in WebServerRequest::get_url_site(). --- modules/web/http/web_server_request.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/web/http/web_server_request.cpp b/modules/web/http/web_server_request.cpp index ccde8c54a..5acf37a3c 100644 --- a/modules/web/http/web_server_request.cpp +++ b/modules/web/http/web_server_request.cpp @@ -418,6 +418,10 @@ String WebServerRequest::get_url_root_current() const { String WebServerRequest::get_url_site() const { String path = get_host(); + if (path.length() == 0 || path[path.length() - 1] != '/') { + path += '/'; + } + int s = MIN(_path_stack_pointer + 1, _path_stack.size()); for (int i = 0; i < s; ++i) {