From a1ea79af0c483adf9758054a8d2cb4cd99577661 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 2 Jan 2018 12:07:26 +0100 Subject: [PATCH] Fixed behaviour when stream cannot be loaded for JSON/JS and HTML page outputs # Conflicts: # src/output/output_http_internal.cpp --- src/output/output_http_internal.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/output/output_http_internal.cpp b/src/output/output_http_internal.cpp index 6b55a3ed..14825e8f 100644 --- a/src/output/output_http_internal.cpp +++ b/src/output/output_http_internal.cpp @@ -44,6 +44,9 @@ namespace Mist { if (H.url.size() >= 3 && H.url.substr(H.url.size() - 3) == ".js"){ JSON::Value json_resp; json_resp["error"] = "Could not retrieve stream. Sorry."; + if (config->getString("nostreamtext") != ""){ + json_resp["on_error"] = config->getString("nostreamtext"); + } if (H.url.size() >= 5 && H.url.substr(0, 5) == "/json"){ H.Clean(); H.SetBody(json_resp.toString()); @@ -224,6 +227,15 @@ namespace Mist { void OutHTTP::HTMLResponse(){ std::string method = H.method; HTTP::URL fullURL(H.GetHeader("Host")); + /*LTS-START*/ + if (config->getString("pubaddr") != ""){ + HTTP::URL altURL(config->getString("pubaddr")); + fullURL.protocol = altURL.protocol; + if (altURL.host.size()){fullURL.host = altURL.host;} + fullURL.port = altURL.port; + fullURL.path = altURL.path; + } + /*LTS-END*/ std::string uAgent = H.GetHeader("User-Agent"); H.Clean(); H.SetHeader("Content-Type", "text/html");