-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly support multiValueHeaders in rust functions during dev…
…elopment (#4632) `multiValueHeaders` was simply not forwarded from the response of the rust function Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a8bfc66
commit 4d7a15b
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const test = require('ava') | ||
const sinon = require('sinon') | ||
|
||
const { rewiremock } = require('../../../../../integration/utils/rewiremock') | ||
|
||
const runFunctionsProxySpy = sinon.stub() | ||
// eslint-disable-next-line n/global-require | ||
const { invokeFunction } = rewiremock.proxy(() => require('../../../../../../src/lib/functions/runtimes/rust/index'), { | ||
'../../../../../../src/lib/functions/local-proxy': { | ||
runFunctionsProxy: runFunctionsProxySpy, | ||
}, | ||
}) | ||
|
||
const invokeFunctionMacro = test.macro({ | ||
async exec(t, prop, expected) { | ||
runFunctionsProxySpy.resolves({ stdout: JSON.stringify({ [prop]: expected }) }) | ||
|
||
const match = await invokeFunction({ func: { mainFile: '', buildData: {} } }) | ||
t.deepEqual(match[prop], expected) | ||
}, | ||
title(providedTitle, prop) { | ||
return `should return ${prop}` | ||
}, | ||
}) | ||
|
||
test(invokeFunctionMacro, 'body', 'thebody') | ||
test(invokeFunctionMacro, 'headers', { 'X-Single': 'A' }) | ||
test(invokeFunctionMacro, 'multiValueHeaders', { 'X-Multi': ['B', 'C'] }) | ||
test(invokeFunctionMacro, 'statusCode', 200) |
4d7a15b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📊 Benchmark results
Package size: 287 MB