about summary refs log tree commit diff stats
path: root/src/loader
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/loader
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/loader')
-rw-r--r--src/loader/loader.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/loader/loader.nim b/src/loader/loader.nim
index 1dd34bc6..d7b9a2a5 100644
--- a/src/loader/loader.nim
+++ b/src/loader/loader.nim
@@ -93,7 +93,6 @@ type
   ClientData = ref object
     pid: int
     key: ClientKey
-    referrerPolicy: ReferrerPolicy
     cacheMap: seq[CachedItem]
     config: LoaderClientConfig
 
@@ -127,6 +126,7 @@ type
     # When set to false, requests with a proxy URL are overridden by the
     # loader proxy (i.e. the variable above).
     acceptProxy*: bool
+    referrerPolicy*: ReferrerPolicy
 
   FetchPromise* = Promise[JSResult[Response]]
 
@@ -443,7 +443,8 @@ proc onLoad(ctx: LoaderContext; stream: SocketStream; client: ClientData) =
         if cookie != "":
           request.headers["Cookie"] = cookie
     if request.referrer != nil and "Referer" notin request.headers:
-      let r = request.referrer.getReferrer(request.url, client.referrerPolicy)
+      let r = request.referrer.getReferrer(request.url,
+        client.config.referrerPolicy)
       if r != "":
         request.headers["Referer"] = r
     if request.proxy == nil or not client.config.acceptProxy: