File tree Expand file tree Collapse file tree
lib/browser/mqtt_internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ export interface PubackPacketBinary extends IPacketBinary {
226226
227227export interface SubscriptionBinary {
228228 topicFilter : ArrayBuffer ;
229- topicFilterAsString : string ; // the one place we keep around a non-binary value
229+ topicFilterAsString : string ; // keep around the non-binary value for easy validation
230230 qos : number ;
231231 noLocal ?: number ;
232232 retainAsPublished ?: number ;
@@ -247,6 +247,7 @@ export interface UnsubscribePacketBinary extends IPacketBinary {
247247 packetId : number ;
248248
249249 topicFilters : Array < ArrayBuffer > ;
250+ topicFiltersAsStrings : Array < string > ; // keep around the non-binary values for easy validation
250251
251252 userProperties ?: Array < UserPropertyBinary > ;
252253}
@@ -569,11 +570,13 @@ function convertUnsubscribePacketToBinary(packet: UnsubscribePacketInternal, inc
569570 let binary_packet : UnsubscribePacketBinary = {
570571 type : mqtt5_packet . PacketType . Unsubscribe ,
571572 packetId : 0 ,
572- topicFilters : [ ]
573+ topicFilters : [ ] ,
574+ topicFiltersAsStrings : [ ]
573575 } ;
574576
575577 for ( let topicFilter of packet . topicFilters ) {
576578 binary_packet . topicFilters . push ( encoder . encode ( topicFilter ) . buffer ) ;
579+ binary_packet . topicFiltersAsStrings . push ( topicFilter ) ;
577580 }
578581
579582 if ( packet . userProperties != undefined ) {
You can’t perform that action at this time.
0 commit comments