GithubHelp home page GithubHelp logo

Payload format about vmq_webhooks HOT 3 CLOSED

erlio avatar erlio commented on May 31, 2024
Payload format

from vmq_webhooks.

Comments (3)

larshesel avatar larshesel commented on May 31, 2024

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.

dergraf avatar dergraf commented on May 31, 2024

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.

larshesel avatar larshesel commented on May 31, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.