Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

curl -d '{}' /your/swagger/url/here causes a crash #504

@MikeSandfordArundo

Description

@MikeSandfordArundo

I discovered this error and a co-worker did the sleuthing to track down the exact problem. It turns out that curl will default to application/x-www-form-urlencoded when you don't specify a content type. And that can cause a process to crash due to an unhandled exception (at least for us) deep in the bowels of things completely outside of our code.

What happens is that the url encoded data gets choked on right here: https://github.com/apigee-127/swagger-tools/blob/master/middleware/swagger-metadata.js#L206

He changed that "%s" to "%j" and no more problems.

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