You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
i use http2 protocol start a server. but i meet some wrong. #1 response miss content-length #2 server conn will close before reply response when get a data frame with end flag. #3 some bad code.
example:
func: server.rpcServer.ServeConn:
/**
go func(id string, psock *socket.Socket) {
wg.Add(1)
// add to the waitgroup
......
}
*/
Expected behavior #1 when receive frame data with end flag, close conn after reply response. #2 bad code, may cause response can not reply. #3 http2 response header should have 'Content-Length'.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: Mac
Browser curl/7.84.0
Version 13.0
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
i use http2 protocol start a server. but i meet some wrong.
#1 response miss content-length
#2 server conn will close before reply response when get a data frame with end flag.
#3 some bad code.
example:
func: server.rpcServer.ServeConn:
/**
go func(id string, psock *socket.Socket) {
wg.Add(1)
// add to the waitgroup
......
}
*/
To Reproduce
Server Start Code:
/**
func main() {
cert, err := tls.LoadX509KeyPair(
<pub>
,<key>
)if err != nil {
log.Printf(
key pair failed, error %v
, err)return
}
srv := server.NewServer(server.Name(
testABC
), server.Transport(transport.NewTransport(transport.TLSConfig(&tls.Config{InsecureSkipVerify: true,
Certificates: []tls.Certificate{cert},
NextProtos: []string{
h2
,http/1.1
},}), transport.Secure(true))))
srv.Init(server.Wait(nil))
err = srv.Handle(srv.NewHandler(&HelloServer{}))
if err != nil {
log.Printf("new handler failed, error %v", err)
return
}
err = srv.Start()
if err != nil {
log.Printf("go-micro start failed")
}
}
*/
request server example:
curl request:
curl --http2 --keepalive-time 60 --cacert -iv -H 'Content-Type: application/json'
-H 'Micro-Service: HelloServer'
-H 'Micro-Method: Call'
-H 'Micro-Endpoint: HelloServer.Call'
--data-raw '{}'
-H 'Connection: keep-alive'
https://addr/
curl response:
< HTTP/2 200
HTTP/2 200
< content-type: application/json
content-type: application/json
< date: Sun, 02 Apr 2023 08:47:55 GMT
date: Sun, 02 Apr 2023 08:47:55 GMT
<
{"A":"hello world"}
Expected behavior
#1 when receive frame data with end flag, close conn after reply response.
#2 bad code, may cause response can not reply.
#3 http2 response header should have 'Content-Length'.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: