Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com> (cherry picked from commit d71817464e859cd323d6cdaf4dec5a9dd530f57e)
14 lines
277 B
Go
14 lines
277 B
Go
package httputils
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestDetectContentType(t *testing.T) {
|
|
input := []byte("That is just a plain text")
|
|
|
|
contentType, _, err := DetectContentType(input)
|
|
if err != nil || contentType != "text/plain" {
|
|
t.Errorf("TestDetectContentType failed")
|
|
}
|
|
}
|