Skip to content

Commit

Permalink
[receiver/opencensusreceiver]Use http constants to replace numbers (#…
Browse files Browse the repository at this point in the history
…18830)

Signed-off-by: xin.li <xin.li@daocloud.io>
  • Loading branch information
my-git9 authored Feb 22, 2023
1 parent 7ad3011 commit 956be3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions receiver/opencensusreceiver/opencensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestGrpcGateway_endToEnd(t *testing.T) {
}
]
}`)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(traceJSON))
req, err := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(traceJSON))
require.NoError(t, err, "Error creating trace POST request: %v", err)
req.Header.Set("Content-Type", "application/json")

Expand Down Expand Up @@ -197,7 +197,7 @@ func TestMetricsGrpcGatewayCors_endToEnd(t *testing.T) {
}

func verifyCorsResp(t *testing.T, url string, origin string, wantStatus int, wantAllowed bool) {
req, err := http.NewRequest("OPTIONS", url, nil)
req, err := http.NewRequest(http.MethodOptions, url, nil)
require.NoError(t, err, "Error creating trace OPTIONS request: %v", err)
req.Header.Set("Origin", origin)
req.Header.Set("Access-Control-Request-Method", "POST")
Expand Down

0 comments on commit 956be3a

Please sign in to comment.