Skip to content

Commit 753abcd

Browse files
committed
Rename download.mimetype.mapping configuration to repository.mimetype_mapping
1 parent f346b3f commit 753abcd

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

custom/conf/app.example.ini

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,15 @@ PATH =
903903
;; - approved: only sign when merging an approved pr to a protected branch
904904
;MERGES = pubkey, twofa, basesigned, commitssigned
905905

906+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
907+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
908+
;[repository.mimetype_mapping]
909+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
910+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
911+
;;
912+
;; Custom MIME type mapping for downloadable files
913+
;.apk=application/vnd.android.package-archive
914+
906915
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
907916
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
908917
;[project]
@@ -912,7 +921,6 @@ PATH =
912921
;PROJECT_BOARD_BASIC_KANBAN_TYPE = To Do, In Progress, Done
913922
;PROJECT_BOARD_BUG_TRIAGE_TYPE = Needs Triage, High Priority, Low Priority, Closed
914923

915-
916924
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
917925
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
918926
;[cors]
@@ -2037,8 +2045,3 @@ PATH =
20372045
;;
20382046
;; Minio enabled ssl only available when STORAGE_TYPE is `minio`
20392047
;MINIO_USE_SSL = false
2040-
2041-
; Custom mime type mapping for downloadable files
2042-
;[download.mimetype.mapping]
2043-
;.apk=application/vnd.android.package-archive
2044-
;.js=application/javascript

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
143143

144144
- `LOCAL_COPY_PATH`: **tmp/local-repo**: Path for temporary local repository copies. Defaults to `tmp/local-repo`
145145

146+
## Repository - MIME type mapping (`repository.mimetype_mapping`)
147+
148+
Configuration for set the expected MIME type based on file extensions of downloadable files. Configuration presents in key-value pairs and file extensions starts with leading `.`.
149+
150+
The following configuration set `Content-Type: application/vnd.android.package-archive` header when downloading files with `.apk` file extension.
151+
```ini
152+
.apk=application/vnd.android.package-archive
153+
```
154+
146155
## CORS (`cors`)
147156

148157
- `ENABLED`: **false**: enable cors headers (disabled by default)
@@ -966,15 +975,6 @@ MINIO_USE_SSL = false
966975

967976
And used by `[attachment]`, `[lfs]` and etc. as `STORAGE_TYPE`.
968977

969-
## MIME type mapping (`download.mimetype.mapping`)
970-
971-
Configuration for set the expected MIME type based on file extensions of downloadable files. Configuration presents in key-value pairs and file extensions starts with leading `.`.
972-
973-
The following configuration set `Content-Type: application/javascript` header when downloading files with `.js` file extension.
974-
```ini
975-
.js=application/javascript
976-
```
977-
978978
## Other (`other`)
979979

980980
- `SHOW_FOOTER_BRANDING`: **false**: Show Gitea branding in the footer.

modules/setting/mime_type_map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var (
1818
)
1919

2020
func newMimeTypeMap() {
21-
sec := Cfg.Section("download.mimetype.mapping")
21+
sec := Cfg.Section("repository.mimetype_mapping")
2222
keys := sec.Keys()
2323
m := make(map[string]string, len(keys))
2424
for _, key := range keys {

0 commit comments

Comments
 (0)