hyper-systems / ocaml-mqtt

MQTT client for OCaml
https://hyper-systems.github.io/ocaml-mqtt
19 stars 5 forks source link

Reject empty topics in subscription #18

Closed clecat closed 2 years ago

clecat commented 2 years ago

According to the MQTT specification version 3.1.1, statement 3.8.3-3: The payload of a SUBSCRIBE packet MUST contain at least one Topic Filter / QoS pair. A SUBSCRIBE packet with no payload is a protocol violation

This pull requests forces an Invalid Argument exception upon calling the subscribe function with an empty list of topics.