Skip to content

Post invalid iso date string success instead of return 400 with error message #7054

Open
@sunshineo

Description

@sunshineo

New Issue Checklist

Issue Description

When post an invalid iso date string, the post success instead of return 400 with error message

Steps to reproduce

curl --location --request POST 'http://localhost:1337/parse/classes/gordonTest' \
--header 'Content-Type: application/json' \
--header 'x-parse-master-key: isotest' \
--data-raw '{
    "isoTest":{
        "__type":"Date",
        "iso":"not iso"
    }
}'

Actual Outcome

The post success and result value is 1970-01-01T00:00:00.000Z

Expected Outcome

Returns 400 with message field isoTest is not a proper iso string

Environment

Server

  • Parse Server version: 4.4.0
  • Operating system: Mac
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.2.10
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas

Client
http

Logs

[39645] parse-server running on http://localhost:1337/parse
verbose: REQUEST for [POST] /parse/classes/gordonTest: {
  "isoTest": {
    "__type": "Date",
    "iso": "not iso"
  }
} {"method":"POST","url":"/parse/classes/gordonTest","headers":{"content-type":"application/json","x-parse-master-key":"isotest","user-agent":"PostmanRuntime/7.26.8","accept":"*/*","cache-control":"no-cache","postman-token":"6a0c9a67-cfd9-48d6-8c75-8a1cfa6f40b3","host":"localhost:1337","accept-encoding":"gzip, deflate, br","connection":"keep-alive","content-length":"74"},"body":{"isoTest":{"__type":"Date","iso":"not iso"}}}
verbose: RESPONSE from [POST] /parse/classes/gordonTest: {
  "status": 201,
  "response": {
    "objectId": "K01d1kyetL",
    "createdAt": "2020-12-09T21:55:59.158Z"
  },
  "location": "http://localhost:1337/parse/classes/gordonTest/K01d1kyetL"
} {"result":{"status":201,"response":{"objectId":"K01d1kyetL","createdAt":"2020-12-09T21:55:59.158Z"},"location":"http://localhost:1337/parse/classes/gordonTest/K01d1kyetL"}}

Metadata

Metadata

Assignees

No one assigned

    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