Review fixes

This commit is contained in:
ltdk 2024-09-27 23:08:20 -04:00 committed by crapStone
parent 1c0ce28d8e
commit e34d5275d6
2 changed files with 8 additions and 13 deletions

View file

@ -315,19 +315,15 @@ func (client *Client) extToMime(ext string) string {
return mimeType
}
func (client *Client) getMimeTypeByExtension(resource string) (string, string) {
func (client *Client) getMimeTypeByExtension(resource string) (mimeType, rawType string) {
rawExt := path.Ext(resource)
innerExt := rawExt
switch rawExt {
case ".gz":
fallthrough
case ".br":
fallthrough
case ".zst":
case ".gz", ".br", ".zst":
innerExt = path.Ext(resource[:len(resource)-len(rawExt)])
}
rawType := client.extToMime(rawExt)
mimeType := rawType
rawType = client.extToMime(rawExt)
mimeType = rawType
if innerExt != rawExt {
mimeType = client.extToMime(innerExt)
}