Skip to content

Restrict to send JSON request as string (object expected)#1190

Open
vladdnepr wants to merge 1 commit intooverblog:masterfrom
vladdnepr:patch-1
Open

Restrict to send JSON request as string (object expected)#1190
vladdnepr wants to merge 1 commit intooverblog:masterfrom
vladdnepr:patch-1

Conversation

@vladdnepr
Copy link

@vladdnepr vladdnepr commented Jul 4, 2024

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? no
Fixed tickets
License MIT

Return value of getParsedBody must be array. But passed string will cause TypeError

Example

fetch("ENDPOINT", {
  "headers": {
    "content-type": "application/json",
  },
  "body": "111",
  "method": "POST"
});

Copy link
Contributor

@mcg-web mcg-web left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @vladdnepr, can you add a test covering this case please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants