repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
5d921ed
parent
9013a2b
author
Eric Bower
date
2024-04-02 20:00:26 +0000 UTC
feat(pgs): support yml, eot, and LICENSE

Closes: #118
3 files changed,  +8, -1
M filehandlers/assets/handler.go
+1, -1
1@@ -356,7 +356,7 @@ func (h *UploadAssetHandler) validateAsset(data *FileData) (bool, error) {
2 	}
3 
4 	// special file we use for custom routing
5-	if fname == "_redirects" || fname == "_headers" {
6+	if fname == "_redirects" || fname == "_headers" || fname == "LICENSE" {
7 		return true, nil
8 	}
9 
M pgs/config.go
+3, -0
 1@@ -88,6 +88,9 @@ func NewConfigSite() *shared.ConfigSite {
 2 				".wasm",
 3 				".xsl",
 4 				".opml",
 5+				".eot",
 6+				".yml",
 7+				".yaml",
 8 			},
 9 			MaxSize:       maxSize,
10 			MaxAssetSize:  maxAssetSize,
M shared/storage/proxy.go
+4, -0
 1@@ -78,6 +78,10 @@ func GetMimeType(fpath string) string {
 2 		return "application/wasm"
 3 	} else if ext == ".opml" {
 4 		return "text/x-opml"
 5+	} else if ext == ".eot" {
 6+		return "application/vnd.ms-fontobject"
 7+	} else if ext == ".yml" || ext == ".yaml" {
 8+		return "text/x-yaml"
 9 	} else if ext == ".txt" {
10 		return "text/plain"
11 	}