chore: rename http getter package (#1349)

This commit is contained in:
boojack
2023-03-14 08:38:54 +08:00
committed by GitHub
parent 89053e86b3
commit 8d88477538
7 changed files with 1 additions and 1 deletions

View File

@ -0,0 +1,15 @@
package getter
import (
"mime"
"net/http"
)
func getMediatype(response *http.Response) (string, error) {
contentType := response.Header.Get("content-type")
mediatype, _, err := mime.ParseMediaType(contentType)
if err != nil {
return "", err
}
return mediatype, nil
}