Last active
July 25, 2025 13:37
-
-
Save gszr/65bd520311501dcfec0c2532f3c2d050 to your computer and use it in GitHub Desktop.
callout with duplicated headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "echo", | |
"cache": { | |
"bypass": false | |
}, | |
"depends_on": [], | |
"request": { | |
"url": "http://localhost:8080/anything", | |
"method": "GET", | |
"headers": { | |
"custom": { | |
"Content-Type": "application/application/json" | |
}, | |
"forward": false | |
}, | |
"body": { | |
"custom": { | |
"something": "foobar" | |
}, | |
"forward": true | |
}, | |
"by_lua": "local headers = kong.ctx.shared.callouts.echo.request.params.headers; headers['content-type'] = nil; headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; kong.log.inspect.on(); kong.log.inspect(kong.ctx.shared.callouts.echo.request.params.headers)" | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment