Skip to content

spector - knock sets contentType to application/x-www-form-urlencoded by default when request body missing #6561

Closed
@chrisradek

Description

@chrisradek

For some tests that make a post request with an empty request body, the contentType is being set to application/x-www-form-urlencoded.

Example test:

uri: "/parameters/body-optionality/optional-explicit/omit",
method: "post",
request: {},
response: {
status: 204,
},

This is due to the behavior of axios where it automatically sets this contentType if one does not exist.

http server emitters should probably be able to handle the case of a missing content-type when the request body is empty, but it would be surprising to see a content-type that it wasn't expecting.

Metadata

Metadata

Labels

bugSomething isn't workingspectorIssues related to spector and the spec setstriaged:core

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions