Use http constants instead of string (#5908)

Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
Fish-pro
2023-02-09 19:29:49 +08:00
committed by GitHub
parent 055b2c31a9
commit 039a4d87e2
4 changed files with 7 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ package trace
import (
"context"
"errors"
"net/http"
"net/http/httptest"
"testing"
@@ -152,7 +153,7 @@ func TestTrace_DOH_TraceHeaderExtraction(t *testing.T) {
}
q := new(dns.Msg).SetQuestion("example.net.", dns.TypeA)
req := httptest.NewRequest("POST", "/dns-query", nil)
req := httptest.NewRequest(http.MethodPost, "/dns-query", nil)
outsideSpan := m.StartSpan("test-header-span")
outsideSpan.Tracer().Inject(outsideSpan.Context(), opentracing.HTTPHeaders, opentracing.HTTPHeadersCarrier(req.Header))