summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-11-19 12:23:03 +0100
committerAraq <rumpf_a@web.de>2011-11-19 12:23:03 +0100
commitd0772feb08baaea12bfdad0a7c20a41733f977bd (patch)
tree706734d78ba5463e12614a5cad5dd3981b33f49f /examples
parent62aa8bed3b6472e8acae530f7014e7e5b0c755b5 (diff)
downloadNim-d0772feb08baaea12bfdad0a7c20a41733f977bd.tar.gz
fixed some tests
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/httpserver2.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/httpserver2.nim b/examples/httpserver2.nim
index 0604e6a83..56bd630ad 100755
--- a/examples/httpserver2.nim
+++ b/examples/httpserver2.nim
@@ -110,7 +110,7 @@ proc executeCgi(server: var TServer, client: TSocket, path, query: string,
       if L.startsWith("content-length:"):
         var i = len("content-length:")
         while L[i] in Whitespace: inc(i)
-        contentLength = parseInt(copy(L, i))
+        contentLength = parseInt(substr(L, i))
 
     if contentLength < 0:
       badRequest(client)
@@ -176,7 +176,7 @@ proc acceptRequest(server: var TServer, client: TSocket) =
   # extract path
   if q >= 0:
     # strip "?..." from path, this may be found in both POST and GET
-    path = data[1].copy(0, q-1)
+    path = data[1].substr(0, q-1)
   else:
     path = data[1]
   # path starts with "/", by adding "." in front of it we serve files from cwd
@@ -187,7 +187,7 @@ proc acceptRequest(server: var TServer, client: TSocket) =
   if cmpIgnoreCase(data[0], "GET") == 0:
     if q >= 0:
       cgi = true
-      query = data[1].copy(q+1)
+      query = data[1].substr(q+1)
   elif cmpIgnoreCase(data[0], "POST") == 0:
     cgi = true
     meth = reqPost