diff --git a/CMakeLists.txt b/CMakeLists.txt index f737425..ada646e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12) endif() project(gitea2rss - VERSION 0.5.0 + VERSION 0.5.1 LANGUAGES CXX) # DESCRIPTION was introduced in version 3.9. diff --git a/src/main.cpp b/src/main.cpp index 80e852f..6cd0f5f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,7 +30,7 @@ using Poco::Environment; int main(int argc, char *argv[]) { - const string query = Environment::get("QUERY_STRING"); + const string query = Environment::get("QUERY_STRING", ""); string url; string type = "releases"; @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) if (!query.empty()) { - const string baseurl = Environment::get("GITEA2RSS_BASEURL"); + const string baseurl = Environment::get("GITEA2RSS_BASEURL", ""); if (baseurl.empty()) { cout << "Status: 500 Internal Server Error\n\n"; diff --git a/src/write.cpp b/src/write.cpp index 541be20..d1e333a 100644 --- a/src/write.cpp +++ b/src/write.cpp @@ -44,9 +44,9 @@ void write_line(const uint8_t spaces, const string &tag, const string &value) void write_preamble(const string &url, const string &type) { - const string request_uri = Environment::get("REQUEST_URI"); - const string server_name = Environment::get("SERVER_NAME"); - const string https = Environment::get("HTTPS"); + const string request_uri = Environment::get("REQUEST_URI", ""); + const string server_name = Environment::get("SERVER_NAME", ""); + const string https = Environment::get("HTTPS", ""); string selfurl; if (!request_uri.empty() && !server_name.empty())