add pattern match for topic alias
Prior to this change, it assume that topic_alias exists defaultly which may cause the unexpected bug This change fix this bug above
This commit is contained in:
parent
c8341c85ba
commit
2d10d6971d
|
@ -650,9 +650,15 @@ check_publish(Packet, PState) ->
|
||||||
check_pub_caps(#mqtt_packet{header = #mqtt_packet_header{qos = QoS, retain = Retain},
|
check_pub_caps(#mqtt_packet{header = #mqtt_packet_header{qos = QoS, retain = Retain},
|
||||||
variable = #mqtt_packet_publish{ properties = Properties}},
|
variable = #mqtt_packet_publish{ properties = Properties}},
|
||||||
#pstate{zone = Zone}) ->
|
#pstate{zone = Zone}) ->
|
||||||
#{'Topic-Alias' := TopicAlias} = Properties,
|
emqx_mqtt_caps:check_pub(Zone, #{qos => QoS, retain => Retain});
|
||||||
|
check_pub_caps(#mqtt_packet{header = #mqtt_packet_header{qos = QoS, retain = Retain},
|
||||||
|
variable = #mqtt_packet_publish{
|
||||||
|
properties = #{'Topic-Alias' := TopicAlias}
|
||||||
|
}},
|
||||||
|
#pstate{zone = Zone}) ->
|
||||||
emqx_mqtt_caps:check_pub(Zone, #{qos => QoS, retain => Retain, topic_alias => TopicAlias}).
|
emqx_mqtt_caps:check_pub(Zone, #{qos => QoS, retain => Retain, topic_alias => TopicAlias}).
|
||||||
|
|
||||||
|
|
||||||
check_pub_acl(_Packet, #pstate{is_super = IsSuper, enable_acl = EnableAcl})
|
check_pub_acl(_Packet, #pstate{is_super = IsSuper, enable_acl = EnableAcl})
|
||||||
when IsSuper orelse (not EnableAcl) ->
|
when IsSuper orelse (not EnableAcl) ->
|
||||||
ok;
|
ok;
|
||||||
|
|
Loading…
Reference in New Issue