You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: unhandled exception: index out of bounds [EInvalidIndex]
at the line in httpserver.nim in next() that reads
if cmpIgnoreCase(data[0], "GET") == 0 or cmpIgnoreCase(data[0], "POST") == 0:
This is due to data having no elements, due to buf being the null string. It seems that, rather than sending a request with "GET / HTTP/1.1" as the first line, Chromium is sending a zero-length line. I don't know if this is proper behaviour, but in any case my program should not crash. So I propose changing this to something like
if data.len() == 0 or cmpIgnoreCase(data[0], "GET") == 0 or cmpIgnoreCase(data[0], "POST") == 0:
The text was updated successfully, but these errors were encountered:
I changed the code to not use split() at all which should be more efficient anyway. However, httpclient does not work on my Windows VM at all, so I couldn't test it properly on Windows.
When running the example at http://force7.de/nimrod/httpserver.html , and accessing localhost from Chromium (specifically), I get an
at the line in
httpserver.nim
innext()
that readsThis is due to
data
having no elements, due tobuf
being the null string. It seems that, rather than sending a request with "GET / HTTP/1.1" as the first line, Chromium is sending a zero-length line. I don't know if this is proper behaviour, but in any case my program should not crash. So I propose changing this to something likeThe text was updated successfully, but these errors were encountered: