mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-19 08:41:02 -04:00
19 lines
364 B
Go
19 lines
364 B
Go
|
package httputils
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
// matchesContentType
|
||
|
func TestJsonContentType(t *testing.T) {
|
||
|
if !matchesContentType("application/json", "application/json") {
|
||
|
t.Fail()
|
||
|
}
|
||
|
|
||
|
if !matchesContentType("application/json; charset=utf-8", "application/json") {
|
||
|
t.Fail()
|
||
|
}
|
||
|
|
||
|
if matchesContentType("dockerapplication/json", "application/json") {
|
||
|
t.Fail()
|
||
|
}
|
||
|
}
|