diff options
author | clsr <clsr@clsr.net> | 2016-06-16 20:05:39 +0200 |
---|---|---|
committer | clsr <clsr@clsr.net> | 2016-06-16 20:05:39 +0200 |
commit | 629fcd4f297ffb34b4f3b54326645eabd42ab32c (patch) | |
tree | 7c0ca9d1180b5c848b3d9d23690577aa6bd426dd | |
parent | 81d6bc357a7b0d49ba0c5034f77404dc577cf8aa (diff) | |
download | gomf-629fcd4f297ffb34b4f3b54326645eabd42ab32c.tar.gz gomf-629fcd4f297ffb34b4f3b54326645eabd42ab32c.zip |
Improve automatic generation of upload URL
-rw-r--r-- | USAGE | 3 | ||||
-rw-r--r-- | main.go | 12 |
2 files changed, 12 insertions, 3 deletions
@@ -66,7 +66,7 @@ Running --forbid-ext EXTS forbids file extensions contained in the comma-separated list EXTS - example: --forbid-ext exe,dll,src + example: --forbid-ext exe,dll,scr --forbid-mime TYPES forbids MIME types contained in the comma-separated list TYPES @@ -86,6 +86,7 @@ Running --upload-url URL uses URL as the prefix for address of uploaded files + if missing, uses --upload-host, --https or --http to construct the URL example: --upload-url http://u.example.com/ --grill @@ -71,9 +71,17 @@ func main() { if uploadUrl == "" { if *listenHttps != "" { - uploadUrl = "https://" + *listenHttps + "/u/" + if uploadHost != "" { + uploadUrl = "https://" + uploadHost + "/" + } else { + uploadUrl = "https://" + *listenHttps + "/u/" + } } else if *listenHttp != "" { - uploadUrl = "http://" + *listenHttp + "/u/" + if uploadHost != "" { + uploadUrl = "http://" + uploadHost + "/" + } else { + uploadUrl = "http://" + *listenHttp + "/u/" + } } } |