Comments (3)
Hi - thanks for bringing this issue up - to be honest it's an oversight on my part and your suspicion is entirely correct: the current code cannot handle arbitrary binary payloads, only the subset that consists of utf8 encoded strings.
As you mentioned in vernemq/vernemq#210 the payload would have to be base64 encoded to be a valid json structure - so to support this I suppose we should automatically base64 encode the payload data and let the webhook implementors decode it. This would of course be a breaking change for existing users of the webhooks plugin but I think a necessary one. What do you think @dergraf ?
from vmq_webhooks.
Could we detect if the payload is UTF-8 encoded and pass it as a String or base64 encode it if required?
Another option would be to make some encoders configurable.
from vmq_webhooks.
@dergraf I don't think automatic detection would be a good idea. It would be expensive to do and also it would be confusing for the clients to handle.
I think the only real way forward is to base64 encode by default and maybe add a way to disable it for those that don't need it (which is probably a special case).
from vmq_webhooks.
Related Issues (14)
- auth_on_subscribe, auth_on_publish not being called. HOT 2
- Plugin enable failing with an error HOT 9
- Webhooks Compilation Failure HOT 4
- Validation for vmq_webhooks.conf missing HOT 3
- Documentation gap regarding webhook conflicts HOT 1
- Add optional caching for `auth_on_subscribe` and `auth_on_publish` hooks HOT 1
- Persisting web hooks across broker restarts HOT 11
- When VerneMQ triggers event "auth_on_subscribe" and "auth_on_publish" HOT 1
- "Auth on Publish" fails repeatly HOT 3
- Saving webhooks on stop, loading webhooks on start HOT 3
- Subscriber_id modifier with auth_on_register hook is not applied HOT 4
- Received payload is not JSON error on "on_publish" hook HOT 2
- auth_on_register username/password are "undefined" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vmq_webhooks.