Skip to content

Commit

Permalink
Add comment to clarify the test server behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
yohfee committed Nov 13, 2023
1 parent 949ecf7 commit 53b1fa2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mackerel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func Test_requestInternal(t *testing.T) {
}
for _, test := range tests {
t.Run(fmt.Sprintf("%s with %v body", test.method, test.body), func(tt *testing.T) {
// Test server that make requests consistent with Mackerel behavior
ts := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
if !test.hasContentTypeHeader && req.Header.Get("Content-Type") == "application/json" {
t.Error("Content-Type header should not have application/json")
Expand Down

0 comments on commit 53b1fa2

Please sign in to comment.