Skip to content

Commit f9fb708

Browse files
committed
Record ContentType on incoming test requests
1 parent b6c60a2 commit f9fb708

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

internal/mbtest/test_server.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
)
1111

1212
type request struct {
13-
Body []byte
14-
Method string
15-
URL *url.URL
13+
Body []byte
14+
ContentType, Method string
15+
URL *url.URL
1616
}
1717

1818
// Request contains the lastly received http.Request by the fake server.
@@ -35,8 +35,9 @@ func EnableServer(m *testing.M) {
3535
func initAndStartServer() {
3636
server = httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
3737
Request = request{
38-
Method: r.Method,
39-
URL: r.URL,
38+
ContentType: r.Header.Get("Content-Type"),
39+
Method: r.Method,
40+
URL: r.URL,
4041
}
4142

4243
var err error

0 commit comments

Comments
 (0)