diff options
author | bptato <nincsnevem662@gmail.com> | 2023-07-02 14:13:02 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-07-02 14:13:02 +0200 |
commit | 341299a491183c7c99f98b0ed3ce13307ab20b17 (patch) | |
tree | 9d96d9b18284c3d35bd0bdca6afdd833a68a5b73 /src/io/headers.nim | |
parent | b1fde40677d0cfeb5a5c28bdd0aeca775b6aa0e1 (diff) | |
download | chawan-341299a491183c7c99f98b0ed3ce13307ab20b17.tar.gz |
Add platform object conversion to union type
And with that, implement Request constructor with a Request init.
Diffstat (limited to 'src/io/headers.nim')
-rw-r--r-- | src/io/headers.nim | 5 |
1 files changed, 5 insertions, 0 deletions
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: |