diff options
Diffstat (limited to 'src/local')
-rw-r--r-- | src/local/client.nim | 1 | ||||
-rw-r--r-- | src/local/container.nim | 6 | ||||
-rw-r--r-- | src/local/pager.nim | 10 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/local/client.nim b/src/local/client.nim index 5a02d2a8..8351c4b1 100644 --- a/src/local/client.nim +++ b/src/local/client.nim @@ -630,6 +630,7 @@ proc newClient*(config: Config, forkserver: ForkServer, mainproc: Pid): Client = loader: forkserver.newFileLoader( defaultHeaders = config.getDefaultHeaders(), proxy = config.getProxy(), + urimethodmap = config.getURIMethodMap(), acceptProxy = true ), jsrt: jsrt, diff --git a/src/local/container.nim b/src/local/container.nim index ce049c08..d3d0b879 100644 --- a/src/local/container.nim +++ b/src/local/container.nim @@ -822,8 +822,10 @@ proc load(container: Container) = if res.code == 0: container.triggerEvent(SUCCESS) # accept cookies - if res.cookies.len > 0 and container.config.cookiejar != nil: - container.config.cookiejar.add(res.cookies) + let cookiejar = container.config.loaderConfig.cookiejar + if res.cookies.len > 0 and cookiejar != nil: + cookiejar.add(res.cookies) + # set referrer policy, if any if res.referrerpolicy.isSome and container.config.referer_from: container.config.referrerpolicy = res.referrerpolicy.get container.setLoadInfo("Connected to " & $container.source.location & ". Downloading...") diff --git a/src/local/pager.nim b/src/local/pager.nim index b07d300e..1333e32f 100644 --- a/src/local/pager.nim +++ b/src/local/pager.nim @@ -35,8 +35,9 @@ import types/buffersource import types/cell import types/color import types/cookie -import types/url import types/opt +import types/urimethodmap +import types/url import utils/twtstr import chakasu/charset @@ -82,6 +83,7 @@ type term*: Terminal tty: File unreg*: seq[(Pid, SocketStream)] + urimethodmap: URIMethodMap username: string jsDestructor(Pager) @@ -211,7 +213,8 @@ proc newPager*(config: Config, attrs: WindowAttributes, statusgrid: newFixedGrid(attrs.width), term: newTerminal(stdout, config, attrs), mimeTypes: config.getMimeTypes(), - mailcap: mailcap + mailcap: mailcap, + urimethodmap: config.getURIMethodMap() ) for err in errs: pager.alert("Error reading mailcap: " & err) @@ -607,6 +610,7 @@ proc applySiteconf(pager: Pager, url: var URL): BufferConfig = var userstyle = pager.config.css.stylesheet var proxy = pager.proxy let mimeTypes = pager.mimeTypes + let urimethodmap = pager.urimethodmap for sc in pager.siteconf: if sc.url.isSome and not sc.url.get.match($url): continue @@ -640,7 +644,7 @@ proc applySiteconf(pager: Pager, url: var URL): BufferConfig = if sc.proxy.isSome: proxy = sc.proxy.get return pager.config.getBufferConfig(url, cookiejar, headers, referer_from, - scripting, charsets, images, userstyle, proxy, mimeTypes) + scripting, charsets, images, userstyle, proxy, mimeTypes, urimethodmap) # Load request in a new buffer. proc gotoURL(pager: Pager, request: Request, prevurl = none(URL), |