-
Notifications
You must be signed in to change notification settings - Fork 45
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
Updating headers to be string type, conversion handled on worker #79
Conversation
src/Converters.ts
Outdated
for (let key in inputHeaders) { | ||
rpcHttpHeaders[key] = toTypedData(inputHeaders[key]); | ||
rpcHttpHeaders[key] = inputHeaders[key].toString(); |
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.
Check for null or empty values inputHeaders[key]?
for (let key in inputHeaders) { | ||
rpcHttpHeaders[key] = toTypedData(inputHeaders[key]); | ||
if (inputHeaders[key] != null) { | ||
rpcHttpHeaders[key] = inputHeaders[key].toString(); |
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.
Add test setting the response headers of different types "stringHeader" , 123
for (let key in inputHeaders) { | ||
rpcHttpHeaders[key] = toTypedData(inputHeaders[key]); | ||
if (inputHeaders[key] != null) { |
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.
if(inputHeaders[key]) should take care of undefined , null
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.
it evaluates to false with a value of 0 though :(
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.
Ahh. Thanks for checking. Add a test for 0 too.
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.
Tracking issue to add test: #81
* Updating headers to be string type, conversion handled on worker * Null check (ty pragna!)
Resolves #78