Set the status code to 400 when invalid query params are sent
This commit is contained in:
1 parent
7b2b89bb4a
commit
618a24112f
1 file changed
+4
-2
+4
-2
@@ -341,8 +341,10 @@ listener = (request, response) ->
|
||||
if urlParts.query.query?
|
||||
try
|
||||
q = JSON.parse(urlParts.query.query)
|
||||
catch e
|
||||
q = {}
|
||||
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