Don't throw exception if environment variables are not set.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
babd67a750
commit
31013f5192
@ -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.
|
||||
|
@ -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";
|
||||
|
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user