From 341299a491183c7c99f98b0ed3ce13307ab20b17 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 2 Jul 2023 14:13:02 +0200 Subject: Add platform object conversion to union type And with that, implement Request constructor with a Request init. --- src/io/headers.nim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/io/headers.nim') diff --git a/src/io/headers.nim b/src/io/headers.nim index 3bc3659b..7db3d8c4 100644 --- a/src/io/headers.nim +++ b/src/io/headers.nim @@ -43,6 +43,11 @@ func newHeaders*(table: Table[string, string]): Headers = else: result.table[k] = @[v] +func clone*(headers: Headers): Headers = + return Headers( + table: headers.table + ) + proc add*(headers: var Headers, k, v: string) = let k = k.toHeaderCase() if k notin headers.table: -- cgit 1.4.1-2-gfad0