http认证 回调 无效

{
“time”: “2024-12-21T13:55:47.001856-06:00”,
“msg”: “http_connector_received”,
“meta”: {
“username”: “3_test”,
“trace_tag”: “QUERY”,
“state”: {
“scheme”: “http”,
“request”: “undefined”,
“port”: 80,
“pool_type”: “random”,
“pool_name”: “emqx_authn_http:53038”,
“host”: “mir3000.xxx.vip”,
“connect_timeout”: 15000
},
“rule_trigger_ts”: ,
“rule_ids”: ,
“request”: “{<<"/api/yong/mqttlogin">>,[{<<"content-type">>,<<"application/json">>}],<<"******">>}”,
“peername”: “194.87.198.xxx:38733”,
“note”: “the request body is redacted due to security reasons”,
“connector”: “emqx_authn_http:53038”,
“clientid”: “App_0109”,
“client_ids”: ,
“action_id”: “undefined”
},
“level”: “debug”
}

下面是我回调的代码
header(‘Content-Type: application/json’);

$data["result"]= "allow"; 
$data["is_superuser"]= true; 

echo json_encode($data);

不知道是哪里写错了,明明判断都验证成功了,输出 result为 allow 后mqqt识别不了

我看你这日志和代码也没问题。

所以才来问,太奇怪了。
mqtt发过来的传参收到了,响应结果也是按官网格式来的……mqtt识别不了

可以检查一个 http header 里面的是不是application 是不是 json