mirror of
https://github.com/go-gitea/gitea.git
synced 2024-08-25 21:44:20 -04:00
Change all license headers to comply with REUSE specification. Fix #16132 Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
29 lines
594 B
Go
29 lines
594 B
Go
// Copyright 2021 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package setting
|
|
|
|
import "strings"
|
|
|
|
// MimeTypeMap defines custom mime type mapping settings
|
|
var MimeTypeMap = struct {
|
|
Enabled bool
|
|
Map map[string]string
|
|
}{
|
|
Enabled: false,
|
|
Map: map[string]string{},
|
|
}
|
|
|
|
func newMimeTypeMap() {
|
|
sec := Cfg.Section("repository.mimetype_mapping")
|
|
keys := sec.Keys()
|
|
m := make(map[string]string, len(keys))
|
|
for _, key := range keys {
|
|
m[strings.ToLower(key.Name())] = key.Value()
|
|
}
|
|
MimeTypeMap.Map = m
|
|
if len(keys) > 0 {
|
|
MimeTypeMap.Enabled = true
|
|
}
|
|
}
|