Skip to content

Cannot extract keys when Content-type header is not set #147

@leorush

Description

@leorush

When Content-type header is not set, mmock cannot extract keys.

Example log:
{ "scheme": "http", "host": "1", "port": "80", "method": "POST", "path": "/jsonrpc/v1/payments.create", "queryStringParameters": {}, "fragment": "", "headers": { "Accept-Encoding": [ "gzip" ], "Authorization": [ "Basic cWE6cWE=" ], "Cache-Control": [ "no-cache" ], "Content-Length": [ "33" ], "Cookies": [ "{}" ], "User-Agent": [ "Go-http-client/1.1" ] }, "cookies": {}, "body": "{\"id\":\"e2a69502\",\"jsonrpc\":\"2.0\"}" }

Mapping:

{"id": "{{request.body.id}}", "jsonrpc": "{{request.body.jsonrpc}}"}

What mmock returns:
{"id": "{{request.body.id}}", "jsonrpc": "{{request.body.jsonrpc}}"}

P.S. Sorry, i got it wrong for the first time, because of escaped JSON in log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions