about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-15 00:41:17 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-15 00:41:54 +0100
commitb175d8200561f6afc894b40aaf70502ee529aed8 (patch)
tree8c2998ab4edce764eced2f5dfa3f5b03b557516c /src/config
parent880685a1c3d7b0e4ac386783489512b61aeb806c (diff)
downloadchawan-b175d8200561f6afc894b40aaf70502ee529aed8.tar.gz
Clean up BufferConfig
It was defined in the wrong module, and unnecessarily included
LoaderClientConfig.

Also, referrerPolicy was not being propagated to loader clients because
it was (incorrectly) in BufferConfig instead of LoaderClientConfig.
Diffstat (limited to 'src/config')
-rw-r--r--src/config/config.nim43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/config/config.nim b/src/config/config.nim
index d08cf958..912c35e6 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -7,18 +7,15 @@ import config/chapath
 import config/mailcap
 import config/mimetypes
 import config/toml
-import io/urlfilter
 import js/error
 import js/javascript
 import js/propertyenumlist
 import js/regex
 import loader/headers
-import loader/loader
 import types/cell
 import types/color
 import types/cookie
 import types/opt
-import types/referrer
 import types/urimethodmap
 import types/url
 import utils/mimeguess
@@ -149,19 +146,6 @@ type
     page* {.jsget.}: ActionMap
     line* {.jsget.}: ActionMap
 
-  BufferConfig* = object
-    userstyle*: string
-    referer_from*: bool
-    referrerPolicy*: ReferrerPolicy
-    scripting*: bool
-    charsets*: seq[Charset]
-    images*: bool
-    loaderConfig*: LoaderClientConfig
-    mimeTypes*: MimeTypes
-    isdump*: bool
-    cgiDir*: seq[string]
-    charsetOverride*: Charset
-
   ForkServerConfig* = object
     tmpdir*: string
     ambiguous_double*: bool
@@ -236,33 +220,6 @@ func getProxy*(config: Config): URL =
 func getDefaultHeaders*(config: Config): Headers =
   return newHeaders(config.network.default_headers)
 
-proc getBufferConfig*(config: Config; location: URL; cookiejar: CookieJar,
-    headers: Headers; referer_from, scripting: bool; charsets: seq[Charset];
-    images: bool; userstyle: string; proxy: URL; mimeTypes: MimeTypes;
-    urimethodmap: URIMethodMap; cgiDir: seq[string]; tmpdir: string;
-    charsetOverride: Charset): BufferConfig =
-  let filter = newURLFilter(
-    scheme = some(location.scheme),
-    allowschemes = @["data", "cache"],
-    default = true
-  )
-  return BufferConfig(
-    userstyle: userstyle,
-    referer_from: referer_from,
-    scripting: scripting,
-    charsets: charsets,
-    images: images,
-    mimeTypes: mimeTypes,
-    isdump: config.start.headless,
-    charsetOverride: charsetOverride,
-    loaderConfig: LoaderClientConfig(
-      defaultHeaders: headers,
-      cookiejar: cookiejar,
-      proxy: proxy,
-      filter: filter
-    )
-  )
-
 proc getSiteConfig*(config: Config, jsctx: JSContext): seq[SiteConfig] =
   for sc in config.siteconf:
     var conf = SiteConfig(