apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.54k stars 26.44k forks source link

[Bug] okclient or curl http2 return result error #14799

Closed smalltalkhyb closed 1 month ago

smalltalkhyb commented 1 month ago

Pre-check

Search before asking

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

jdk17

Steps to reproduce this issue

code

    @RequestMapping(
        method = {RequestMethod.POST},
        value = {"/manager-bu/buNameAll"},
        produces = {"application/json"}
    )
    List<String> allBuName();
    @Override
    public List<String> allBuName() {
        return sysManagerBuQueryService.getAllBuName();
    }

Test http1.1 200 OK

`curl -v 'http://localhost:8080/manager-bu/buNameAll' \ --header 'Authorization: eyUserJNCxrYCkpFYTPvHpGuH6IM8RWRrvhx4PYwZwjqmxeDZkLfvuuS3EXiWRGnkwwCRj' \ --header 'deprecated: 1' \ --header 'must-auth-heade: 1' \ --header 'x-mse-tag: xingzhihe' \ --header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \ --header 'Content-Type: application/json' \ --data '{}'

Test http2 200 error HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR

`curl --http2 -v 'http://localhost:8080/manager-bu/buNameAll' \ --header 'Authorization: eyUserJNCxrYCkpFYTPvHpGuH6IM8RWRrvhx4PYwZwjqmxeDZkLfvuuS3EXiWRGnkwwCRj' \ --header 'deprecated: 1' \ --header 'must-auth-heade: 1' \ --header 'x-mse-tag: xingzhihe' \ --header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \ --header 'Content-Type: application/json' \ --data '{}'

What you expected to happen

return result ok

{"code":"000","message":"操作成功","data":["uap","bap","ad","marketing","user","pay","driver","asset","trip","diq","iot","bigdata","matching","Unknown"],"success":true,"devMessage":null,"traceId":"00000000000000000000000000000000","timestamp":1729474933016}

Anything else

No response

Are you willing to submit a pull request to fix on your own?

Code of Conduct

oxsean commented 1 month ago

Can't reproduce

 curl -v 'http://localhost:50051/manager-bu/buNameAll' --header 'Authorization: eyUserJNCxrYCkpFYTPvHpGuH6IM8RWRrvhx4PYwZwjqmxeDZkLfvuuS3EXiWRGnkwwCRj' --header 'deprecated: 1' --header 'must-auth-heade: 1' --header 'x-mse-tag: xingzhihe' --header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' --header 'Content-Type: application/json' --data '{}' --http2
* Host localhost:50051 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:50051...
* Connected to localhost (::1) port 50051
> POST /manager-bu/buNameAll HTTP/1.1
> Host: localhost:50051
> Accept: */*
> Connection: Upgrade, HTTP2-Settings
> Upgrade: h2c
> HTTP2-Settings: AAMAAABkAAQAoAAAAAIAAAAA
> Authorization: eyUserJNCxrYCkpFYTPvHpGuH6IM8RWRrvhx4PYwZwjqmxeDZkLfvuuS3EXiWRGnkwwCRj
> deprecated: 1
> must-auth-heade: 1
> x-mse-tag: xingzhihe
> User-Agent: Apifox/1.0.0 (https://apifox.com)
> Content-Type: application/json
> Content-Length: 2
>
* upload completely sent off: 2 bytes
< HTTP/1.1 101 Switching Protocols
< connection: upgrade
< upgrade: h2c
<
* Received 101, Switching to HTTP/2
< HTTP/2 200
< content-type: application/json
< vary: origin, access-control-request-method, access-control-request-headers
<
["bu1","bu2","bu3"]* Connection #0 to host localhost left intact