1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-03-02 03:40:21 +00:00

resolves #87: Fix archive url: missing slash

Terminate default URL with slash, add slash to custom URL when absent
This commit is contained in:
Vaclav Valicek
2019-03-27 08:00:13 +01:00
committed by Oliver Giles
parent bb81931ce9
commit 303fe7c6ae
2 changed files with 7 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ namespace {
// Default values when none were supplied in $LAMINAR_CONF_FILE (/etc/laminar.conf)
constexpr const char* INTADDR_RPC_DEFAULT = "unix-abstract:laminar";
constexpr const char* INTADDR_HTTP_DEFAULT = "*:8080";
constexpr const char* ARCHIVE_URL_DEFAULT = "/archive";
constexpr const char* ARCHIVE_URL_DEFAULT = "/archive/";
}
// short syntax helpers for kj::Path
@@ -78,8 +78,12 @@ Laminar::Laminar(const char *home) :
KJ_ASSERT(home[0] == '/');
archiveUrl = ARCHIVE_URL_DEFAULT;
if(char* envArchive = getenv("LAMINAR_ARCHIVE_URL"))
if(char* envArchive = getenv("LAMINAR_ARCHIVE_URL")) {
archiveUrl = envArchive;
if(archiveUrl.back() != '/')
archiveUrl.append("/");
}
numKeepRunDirs = 0;
db = new Database((homePath/"laminar.sqlite").toString(true).cStr());