diff options
author | bptato <nincsnevem662@gmail.com> | 2024-08-15 21:25:31 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-08-15 21:28:15 +0200 |
commit | 2b8c31f9a504103ce90fe26f6c16412a85cdd9c5 (patch) | |
tree | eaf6facc85382512612714d1044936ee46952e8c /src/loader | |
parent | 4bf895db711f3d4d229d3f18fbb2145cce2a73af (diff) | |
download | chawan-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.nim | 5 |
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]] |