Closed
Description
/GET /users/me
matches two routes because of the overlap with /GET /users/:objectId
. The second handler is called with the objectId
set to me
, which fails with a "Object not found." error.
Steps to reproduce
- Turn on verbose logging.
- create session
curl -X GET /users/me
(with necessary headers)
Expected Results
There should only be one request logged, and no "Object not found." error.
Actual Outcome
Two separate logs for verbose: REQUEST for [GET] /parse/1/users/me
, an "Object not found." ParseError, and an express.js error Error: Can't set headers after they are sent.
Environment Setup
parse-server 2.2.23 locally and on AWS
Logs/Trace
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 error: Error generating response. ParseError { code: 101, message: 'Object not found.' } code=101, message=Object not found.
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 Tue, 25 Oct 2016 06:25:52 GMT express:router handleParseErrors : /parse/1/users/me
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at next (/app/node_modules/express/lib/router/index.js:271:10)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 Error: Can't set headers after they are sent.
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:356:11)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at ServerResponse.header (/app/node_modules/express/lib/response.js:719:10)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at ServerResponse.send (/app/node_modules/express/lib/response.js:164:12)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at ServerResponse.json (/app/node_modules/express/lib/response.js:250:15)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at handleParseErrors (/app/node_modules/parse-server/lib/middlewares.js:248:9)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at Layer.handle_error (/app/node_modules/express/lib/router/layer.js:71:5)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at /app/node_modules/express/lib/router/index.js:280:7
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at Function.process_params (/app/node_modules/express/lib/router/index.js:330:12)
2016-10-25T06:25:52Z parse:RTWTPIYXJKL/4d7370c0c344 at trim_prefix (/app/node_modules/express/lib/router/index.js:310:13)
Metadata
Metadata
Assignees
Labels
No labels