@@ -151,7 +151,7 @@ func TestMiddlewareExecution(t *testing.T) {
151151 // Test handler-only call
152152 router .ServeHTTP (rw , req )
153153
154- if bytes .Compare (rw .Body .Bytes (), handlerStr ) != 0 {
154+ if ! bytes .Equal (rw .Body .Bytes (), handlerStr ) {
155155 t .Fatal ("Handler response is not what it should be" )
156156 }
157157
@@ -166,7 +166,7 @@ func TestMiddlewareExecution(t *testing.T) {
166166 })
167167
168168 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 ... )) {
170170 t .Fatal ("Middleware + handler response is not what it should be" )
171171 }
172172}
@@ -368,7 +368,7 @@ func TestCORSMethodMiddleware(t *testing.T) {
368368 t .Errorf ("Expected body '%s', found '%s'" , tt .response , rr .Body .String ())
369369 }
370370
371- allowedMethods := rr .HeaderMap .Get ("Access-Control-Allow-Methods" )
371+ allowedMethods := rr .Header () .Get ("Access-Control-Allow-Methods" )
372372
373373 if allowedMethods != tt .expectedAllowedMethods {
374374 t .Errorf ("Expected Access-Control-Allow-Methods '%s', found '%s'" , tt .expectedAllowedMethods , allowedMethods )
0 commit comments