Skip to content

Object with attribute named "url" is not save if the value has not a string #3569

Closed
@paulovitin

Description

@paulovitin

Issue Description

If you try to create an Object with an attribute named "url" and the value of this attribute is not a "string" the LoggerController throw an error

Steps to reproduce

Try create a Object with this structure

{
  "url": ["https://github.com", "https://google.com"],
}

Expected Results

Create the object with success

Actual Outcome

{"code":1,"message":"Internal server error."}

Environment Setup

  • Server

    • parse-server version: 2.3.5
    • Operating System: Ubuntu 14.04
    • Localhost or remote server?: Heroku
  • Database

    • PostgreSQL version: 9.6
    • Localhost or remote server?: Heroku

Logs/Trace

TypeError: Parameter "url" must be a string, not object
Url.parse (url.js:87:11)
Object.urlParse [as parse] (url.js:81:5)
LoggerController.maskSensitiveUrl (/app/node_modules/parse-server/lib/Controllers/LoggerController.js:58:36)
/app/node_modules/parse-server/lib/Controllers/LoggerController.js:82:26
Array.map (native)
LoggerController.maskSensitive (/app/node_modules/parse-server/lib/Controllers/LoggerController.js:70:23)
LoggerController.log (/app/node_modules/parse-server/lib/Controllers/LoggerController.js:122:19)
LoggerController.debug (/app/node_modules/parse-server/lib/Controllers/LoggerController.js:149:19)
debug (/app/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:43:13)
PostgresStorageAdapter.createObject (/app/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:764:7)
/app/node_modules/parse-server/lib/Controllers/DatabaseController.js:635:29
process._tickDomainCallback (internal/process/next_tick.js:129:7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions