-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: botFrameworkClientFetchImpl function missing headers from Zod validation #3959
Conversation
Pull Request Test Coverage Report for Build 1381148946
💛 - Coveralls |
|
||
const response = await axios.post(url, JSON.parse(body), { | ||
headers: z.record(z.string()).parse(init.headers ?? {}), | ||
headers: z.record(z.string()).parse(headers ?? {}), |
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.
headers
should already be typed properly from the changes on line 16, so you should just be able to do { headers }
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.
Thanks, @joshgummersall, feedback applied!
libraries/botframework-connector/src/auth/botFrameworkClientImpl.ts
Outdated
Show resolved
Hide resolved
…lidation (#3959) * Fix Zod missing headers validation error * Remove nullish coalescing operator for headers * Clean up botFrameworkClientFetchImpl headers validation * Update botFrameworkClientImpl.ts Co-authored-by: MartLuc <[email protected]>
#3963) * fix: botFrameworkClientFetchImpl function missing headers from Zod validation (#3959) * Fix Zod missing headers validation error * Remove nullish coalescing operator for headers * Clean up botFrameworkClientFetchImpl headers validation * Update botFrameworkClientImpl.ts Co-authored-by: MartLuc <[email protected]> * fix: add more release branches Co-authored-by: Joel Mut <[email protected]> Co-authored-by: MartLuc <[email protected]>
Fixes #minor
Description
This PR fixes an issue when the
Host
wants to send anActivity
to theSkill
using the internalbotFrameworkClientFetchImpl
function to make thePOST
request.This validation error was found as part of the issue BotBuilder-Samples-#3526 to add support for MSI to the JavaScript samples, that currently is under development.
Specific Changes
botFrameworkClientFetchImpl
function, thezod
validation fails to recognize the keys from theheaders
object.Testing
The following images show the error and the bots working after the fix.