Merge pull request #69 from akcoder/invalid_json_crash
Don't crash if the query params are invalid json
This commit is contained in:
commit
0e0a5f5f77
1 file changed
+5
@@ -339,7 +339,12 @@ listener = (request, response) ->
|
||||
|
||||
func = (aliases) ->
|
||||
if urlParts.query.query?
|
||||
try
|
||||
q = JSON.parse(urlParts.query.query)
|
||||
catch err
|
||||
response.writeHead(400)
|
||||
response.end(err.toString())
|
||||
return
|
||||
else
|
||||
q = {}
|
||||
q = query.expand(q, aliases) if collectionName is 'devices'
|
||||
|
||||
Reference in new issue
Block a user