about summary refs log tree commit diff stats
path: root/src/loader/response.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-20 18:12:09 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-20 18:12:09 +0200
commit7c4bb940410c8f5ad59e1d21d5565364a9a0cd71 (patch)
treed46d682ce9d4f308232c961985d8411c2a70197c /src/loader/response.nim
parent723613b0a02605dbf715d74c70b9ec29f1092c76 (diff)
downloadchawan-7c4bb940410c8f5ad59e1d21d5565364a9a0cd71.tar.gz
html: improve Request, derive Client from Window
* make Client an instance of Window (for less special casing)
* misc work on Request & fetch
* improve origin comparison (opaque origins of same URLs are now
  considered the same)
Diffstat (limited to 'src/loader/response.nim')
-rw-r--r--src/loader/response.nim12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/loader/response.nim b/src/loader/response.nim
index 63b07cf1..56e955a3 100644
--- a/src/loader/response.nim
+++ b/src/loader/response.nim
@@ -28,11 +28,11 @@ type
 
   #TODO fully implement headers guards
   HeadersGuard* = enum
-    GUARD_IMMUTABLE = "immutable"
-    GUARD_REQUEST = "request"
-    GUARD_REQUEST_NO_CORS = "request-no-cors"
-    GUARD_RESPONSE = "response"
-    GUARD_NONE = "none"
+    hgImmutable = "immutable"
+    hgRequest = "request"
+    hgRequestNoCors = "request-no-cors"
+    hgResponse = "response"
+    hgNone = "none"
 
   Response* = ref object
     responseType* {.jsget: "type".}: ResponseType
@@ -67,7 +67,7 @@ func makeNetworkError*(): Response {.jsstfunc: "Response:error".} =
     responseType: TYPE_ERROR,
     status: 0,
     headers: newHeaders(),
-    headersGuard: GUARD_IMMUTABLE
+    headersGuard: hgImmutable
   )
 
 func sok(response: Response): bool {.jsfget: "ok".} =