summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2015-08-09 14:08:23 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2015-08-09 14:08:23 +0100
commitf8bababa2af97bfa85c627fb8c394a619c015b47 (patch)
tree5ed8ac156dbac1f975dc39d2f89ed7fb19c31d7c /lib
parent34ca9dd5861d5504bbbeb71469318c8c8caba6d7 (diff)
parent930e90a73058b4ae51364f4c8c4f83a04149a645 (diff)
downloadNim-f8bababa2af97bfa85c627fb8c394a619c015b47.tar.gz
Merge pull request #3197 from tulayang/async
Modify proc asynchttpserver.parseHeader
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/asynchttpserver.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim
index 9e036443c..d9480475a 100644
--- a/lib/pure/asynchttpserver.nim
+++ b/lib/pure/asynchttpserver.nim
@@ -126,8 +126,11 @@ proc parseHeader(line: string): tuple[key, value: string] =
   var i = 0
   i = line.parseUntil(result.key, ':')
   inc(i) # skip :
-  i += line.skipWhiteSpace(i)
-  i += line.parseUntil(result.value, {'\c', '\L'}, i)
+  if i < len(line):
+    i += line.skipWhiteSpace(i)
+    i += line.parseUntil(result.value, {'\c', '\L'}, i)
+  else:
+    result.value = ""
 
 proc parseProtocol(protocol: string): tuple[orig: string, major, minor: int] =
   var i = protocol.skipIgnoreCase("HTTP/")
ub.com> 2020-04-22 17:34:35 +0200 cycle collector (#14071)' href='/ahoang/Nim/commit/lib/system/cellseqs_v2.nim?h=devel&id=269a458d74e9abbc126d96c506b730c37af0932a'>269a458d7 ^
3eb3e6b9a ^

833035bac ^

269a458d7 ^






3eb3e6b9a ^
269a458d7 ^

833035bac ^
3eb3e6b9a ^
269a458d7 ^
3eb3e6b9a ^
269a458d7 ^
3eb3e6b9a ^
dedb04fa9 ^
833035bac ^

dedb04fa9 ^


269a458d7 ^


3eb3e6b9a ^
269a458d7 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56