Skip to content

response object is undefined when calling Parse.Cloud.httpRequest with nonsense url #703

Closed
@yuzeh

Description

@yuzeh

I'm getting an exception whenever I call Parse.Cloud.httpRequest with a nonsense URL. Ideally it should put something sensible in the error callback instead of crashing.

Environment Setup

parse-server v2.1.3

Steps to reproduce

          var promise = Parse.Cloud.httpRequest({
            method: "GET",
            url: "https://www.blah blahblah",
          });

Logs/Trace

TypeError: Cannot read property 'statusCode' of undefined
    at Request._callback (cloudcode/dist/node_modules/parse-server/lib/httpRequest.js:46:35)
    at self.callback (cloudcode/dist/node_modules/parse-server/node_modules/request/request.js:199:22)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)

Metadata

Metadata

Assignees

Labels

type:bugImpaired feature or lacking behavior that is likely assumed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions