even more strict isNil handling for strings/seqs in order to detect bugs

This commit is contained in:
Araq 2018-08-22 12:35:46 +02:00
commit 64517445ea
36 changed files with 193 additions and 245 deletions

View file

@ -135,10 +135,9 @@ iterator decodeData*(allowedMethods: set[RequestMethod] =
## Reads and decodes CGI data and yields the (name, value) pairs the
## data consists of. If the client does not use a method listed in the
## `allowedMethods` set, an `ECgi` exception is raised.
var data = getEncodedData(allowedMethods)
if not isNil(data):
for key, value in decodeData(data):
yield (key, value)
let data = getEncodedData(allowedMethods)
for key, value in decodeData(data):
yield (key, value)
proc readData*(allowedMethods: set[RequestMethod] =
{methodNone, methodPost, methodGet}): StringTableRef =