@@ -33,6 +33,8 @@ const (
3333 HTTPMethodKey = "HttpMethod"
3434 // HTTPHostKey is used to get or set http host in QUIC ALPN if the underlying proxy connection type is HTTP.
3535 HTTPHostKey = "HttpHost"
36+ // HTTPStatus is used to return http status code in QUIC ALPN if the underlying proxy connection type is HTTP.
37+ HTTPStatus = "HttpStatus"
3638
3739 QUICMetadataFlowID = "FlowID"
3840)
@@ -287,7 +289,7 @@ func (hrw *httpResponseAdapter) AddTrailer(trailerName, trailerValue string) {
287289
288290func (hrw * httpResponseAdapter ) WriteRespHeaders (status int , header http.Header ) error {
289291 metadata := make ([]pogs.Metadata , 0 )
290- metadata = append (metadata , pogs.Metadata {Key : "HttpStatus" , Val : strconv .Itoa (status )})
292+ metadata = append (metadata , pogs.Metadata {Key : HTTPStatus , Val : strconv .Itoa (status )})
291293 for k , vv := range header {
292294 for _ , v := range vv {
293295 httpHeaderKey := fmt .Sprintf ("%s:%s" , HTTPHeaderKey , k )
@@ -327,7 +329,7 @@ func (hrw *httpResponseAdapter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
327329}
328330
329331func (hrw * httpResponseAdapter ) WriteErrorResponse (err error ) {
330- _ = hrw .WriteConnectResponseData (err , pogs.Metadata {Key : "HttpStatus" , Val : strconv .Itoa (http .StatusBadGateway )})
332+ _ = hrw .WriteConnectResponseData (err , pogs.Metadata {Key : HTTPStatus , Val : strconv .Itoa (http .StatusBadGateway )})
331333}
332334
333335func (hrw * httpResponseAdapter ) WriteConnectResponseData (respErr error , metadata ... pogs.Metadata ) error {
0 commit comments