summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2017-02-07 18:32:57 +0100
committerDominik Picheta <dominikpicheta@gmail.com>2017-02-07 18:32:57 +0100
commit7c15120247f93cc1b729d33f0af592bc8e5e9937 (patch)
treebecf4fff660ab21a4aada70c95b8eca7c79ab86e
parent8ae05c6555a6a70e907f0640e6200c0aaedd2289 (diff)
downloadNim-7c15120247f93cc1b729d33f0af592bc8e5e9937.tar.gz
Add some tests to httpcore related to #5344.
-rw-r--r--lib/pure/httpcore.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/pure/httpcore.nim b/lib/pure/httpcore.nim
index 48001ccaa..d7f720f66 100644
--- a/lib/pure/httpcore.nim
+++ b/lib/pure/httpcore.nim
@@ -312,3 +312,10 @@ when isMainModule:
   test.add("Connection", "Test")
   doAssert test["Connection", 2] == "Test"
   doAssert "upgrade" in test["Connection"]
+
+  # Bug #5344.
+  doAssert parseHeader("foobar: ") == ("foobar", @[""])
+  let (key, value) = parseHeader("foobar: ")
+  test = newHttpHeaders()
+  test[key] = value
+  doAssert test["foobar"] == ""
\ No newline at end of file