aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config/config.nim3
-rw-r--r--src/types/urimethodmap.nim4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/config/config.nim b/src/config/config.nim
index 38ab6ffb..6500f73c 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -411,11 +411,12 @@ const DefaultURIMethodMap = parseURIMethodMap(staticRead"res/urimethodmap")
proc getURIMethodMap*(config: Config): URIMethodMap =
let configDir = getConfigDir() / "chawan" #TODO store this in config?
- var urimethodmap = DefaultURIMethodMap
+ var urimethodmap: URIMethodMap
for p in config.external.urimethodmap:
let f = openFileExpand(configDir, p)
if f != nil:
urimethodmap.parseURIMethodMap(f.readAll())
+ urimethodmap.append(DefaultURIMethodMap)
return urimethodmap
proc getForkServerConfig*(config: Config): ForkServerConfig =
diff --git a/src/types/urimethodmap.nim b/src/types/urimethodmap.nim
index f9331cfd..48163668 100644
--- a/src/types/urimethodmap.nim
+++ b/src/types/urimethodmap.nim
@@ -73,3 +73,7 @@ proc parseURIMethodMap*(this: var URIMethodMap, s: string) =
proc parseURIMethodMap*(s: string): URIMethodMap =
result = URIMethodMap()
result.parseURIMethodMap(s)
+
+proc append*(this: var URIMethodMap, that: URIMethodMap) =
+ for k, v in that.map:
+ discard this.map.hasKeyOrPut(k, v)