about summary refs log tree commit diff stats
path: root/src/loader
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-08-15 21:25:31 +0200
committerbptato <nincsnevem662@gmail.com>2024-08-15 21:28:15 +0200
commit2b8c31f9a504103ce90fe26f6c16412a85cdd9c5 (patch)
treeeaf6facc85382512612714d1044936ee46952e8c /src/loader
parent4bf895db711f3d4d229d3f18fbb2145cce2a73af (diff)
downloadchawan-2b8c31f9a504103ce90fe26f6c16412a85cdd9c5.tar.gz
dom, xhr: slight progress on modules, fix an XHR bug
* actually download & compile modules (but don't run them yet)
* fix a bug in XHR (on some older Nim versions, move() doesn't
  actually move)
Diffstat (limited to 'src/loader')
-rw-r--r--src/loader/response.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/loader/response.nim b/src/loader/response.nim
index 6463080a..d41f62eb 100644
--- a/src/loader/response.nim
+++ b/src/loader/response.nim
@@ -15,6 +15,7 @@ import monoucha/tojs
 import types/blob
 import types/color
 import types/opt
+import types/referrer
 import types/url
 import utils/mimeguess
 import utils/twtstr
@@ -112,6 +113,10 @@ func getContentLength*(this: Response): int64 =
         return int64(u.get)
   return -1
 
+func getReferrerPolicy*(this: Response): Option[ReferrerPolicy] =
+  this.headers.table.withValue("Referrer-Policy", p):
+    return strictParseEnum[ReferrerPolicy](p[][0])
+
 type TextOpaque = ref object of RootObj
   buf: string
   bodyRead: Promise[JSResult[string]]