github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/api/server/httputils/httputils_test.go (about)

     1  package httputils // import "github.com/docker/docker/api/server/httputils"
     2  
     3  import "testing"
     4  
     5  // matchesContentType
     6  func TestJsonContentType(t *testing.T) {
     7  	if !matchesContentType("application/json", "application/json") {
     8  		t.Fail()
     9  	}
    10  
    11  	if !matchesContentType("application/json; charset=utf-8", "application/json") {
    12  		t.Fail()
    13  	}
    14  
    15  	if matchesContentType("dockerapplication/json", "application/json") {
    16  		t.Fail()
    17  	}
    18  }