Skip to content
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

NATS Client error while processing boolean header values #318

Open
ricardomfmartins opened this issue May 26, 2022 · 1 comment
Open

NATS Client error while processing boolean header values #318

ricardomfmartins opened this issue May 26, 2022 · 1 comment

Comments

@ricardomfmartins
Copy link

ricardomfmartins commented May 26, 2022

I've detected that when we publish a message with headers that include boolean values (see example below), the NATS client fails with the error: 'bool' object has no attribute 'encode'

{"type": "GetStamp", "hasAvailableCapacity": True}

I saw that the _send_publish method inside the client.py is doing a value.encode(), which only supports header values of the type string.
Shouldn't accepting bool header values be a valid option?

@wallyqs
Copy link
Member

wallyqs commented May 26, 2022

Headers have to be strings, so have to stringify before sending. I was hoping that this would have resulted in a type error though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants