New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix:http转grpc响应头设置失败 #113
fix:http转grpc响应头设置失败 #113
Conversation
稍等,我们确定一下 |
http方法发送请求走的是 |
经过确定,只有http需要,http转gRPC是不需要这么写的 |
好的,我在看看,可以实际测试下,我测试就是不行,我也是调试代码发现的,返回的Content-Type是text/plain curl -X POST 'http://127.0.0.1:9400/api/setting/plugin' \
-H 'Content-Type:application/json' \
-d '{
"plugins":[{
"id":"eolinker.com:apinto:http_to_grpc",
"name":"http_to_grpc",
"status":"enable"
}]
}'
curl -X POST 'http://127.0.0.1:9400/api/service' -H 'Content-Type:application/json' -d '{
"name":"grpc_api",
"driver":"http",
"description":"grpc服务",
"timeout":2000,
"retry":3,
"scheme":"http",
"nodes":[
"127.0.0.1:9001"
],
"balance":"round-robin"
}' curl -X POST 'http://127.0.0.1:9400/api/router' -H 'Content-Type:application/json' -d '{
"name":"grpc_router",
"driver": "http",
"description":"grpc路由",
"listen":80,
"method":[
"GET",
"POST"
],
"host":[
],
"location":"/Service.Hello/Hello",
"rules":[
],
"service":"grpc_api@service",
"plugins":{
"http_to_grpc":{
"disable":false,
"config":{
"service":"Service.Hello",
"method":"Hello",
"authority":"",
"format":"json",
"headers":{
},
"reflect":true
}
}
},
"retry":3,
"time_out":2000
}' curl --location --request POST 'http://127.0.0.1:80/Service.Hello/Hello' \
--header 'Content-Type: application/json' \
--header 'Cookie: uid=1' \
--data-raw '{
"name": "baker"
}' |
了解,我们这边复测看看 |
8146e87
to
8bde310
Compare
node/http-context/header.go |
有个疑问,上次改这个 grpc header失效的问题 |
1 确实要跟着改,上次大意了 |
修改和SetHeader一样,您可用修改后提交一个pull,成为我们的贡献者 |
|
No description provided.