mirror of
				https://github.com/ohwgiles/laminar.git
				synced 2025-06-13 12:54:29 +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:
		
							parent
							
								
									bb81931ce9
								
							
						
					
					
						commit
						303fe7c6ae
					
				| @ -51,4 +51,4 @@ | |||||||
| ### uses a very naive and inefficient method. Best to let a real | ### uses a very naive and inefficient method. Best to let a real | ||||||
| ### webserver handle serving those requests. | ### webserver handle serving those requests. | ||||||
| ### | ### | ||||||
| #LAMINAR_ARCHIVE_URL=http://backbone.example.com/ci/archive | #LAMINAR_ARCHIVE_URL=http://backbone.example.com/ci/archive/ | ||||||
|  | |||||||
| @ -56,7 +56,7 @@ namespace { | |||||||
| // Default values when none were supplied in $LAMINAR_CONF_FILE (/etc/laminar.conf)
 | // 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_RPC_DEFAULT = "unix-abstract:laminar"; | ||||||
| constexpr const char* INTADDR_HTTP_DEFAULT = "*:8080"; | 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
 | // short syntax helpers for kj::Path
 | ||||||
| @ -78,8 +78,12 @@ Laminar::Laminar(const char *home) : | |||||||
|     KJ_ASSERT(home[0] == '/'); |     KJ_ASSERT(home[0] == '/'); | ||||||
| 
 | 
 | ||||||
|     archiveUrl = ARCHIVE_URL_DEFAULT; |     archiveUrl = ARCHIVE_URL_DEFAULT; | ||||||
|     if(char* envArchive = getenv("LAMINAR_ARCHIVE_URL")) |     if(char* envArchive = getenv("LAMINAR_ARCHIVE_URL")) { | ||||||
|         archiveUrl = envArchive; |         archiveUrl = envArchive; | ||||||
|  |         if(archiveUrl.back() != '/') | ||||||
|  |             archiveUrl.append("/"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     numKeepRunDirs = 0; |     numKeepRunDirs = 0; | ||||||
| 
 | 
 | ||||||
|     db = new Database((homePath/"laminar.sqlite").toString(true).cStr()); |     db = new Database((homePath/"laminar.sqlite").toString(true).cStr()); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user