mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-05-12 13:07:50 +00:00
Review fixes
This commit is contained in:
parent
1c0ce28d8e
commit
e34d5275d6
2 changed files with 8 additions and 13 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue