@@ -151,7 +151,7 @@ func TestMiddlewareExecution(t *testing.T) {
151
151
// Test handler-only call
152
152
router .ServeHTTP (rw , req )
153
153
154
- if bytes .Compare (rw .Body .Bytes (), handlerStr ) != 0 {
154
+ if ! bytes .Equal (rw .Body .Bytes (), handlerStr ) {
155
155
t .Fatal ("Handler response is not what it should be" )
156
156
}
157
157
@@ -166,7 +166,7 @@ func TestMiddlewareExecution(t *testing.T) {
166
166
})
167
167
168
168
router .ServeHTTP (rw , req )
169
- if bytes .Compare (rw .Body .Bytes (), append (mwStr , handlerStr ... )) != 0 {
169
+ if ! bytes .Equal (rw .Body .Bytes (), append (mwStr , handlerStr ... )) {
170
170
t .Fatal ("Middleware + handler response is not what it should be" )
171
171
}
172
172
}
@@ -368,7 +368,7 @@ func TestCORSMethodMiddleware(t *testing.T) {
368
368
t .Errorf ("Expected body '%s', found '%s'" , tt .response , rr .Body .String ())
369
369
}
370
370
371
- allowedMethods := rr .HeaderMap .Get ("Access-Control-Allow-Methods" )
371
+ allowedMethods := rr .Header () .Get ("Access-Control-Allow-Methods" )
372
372
373
373
if allowedMethods != tt .expectedAllowedMethods {
374
374
t .Errorf ("Expected Access-Control-Allow-Methods '%s', found '%s'" , tt .expectedAllowedMethods , allowedMethods )
0 commit comments