mirror of
https://github.com/ZizzyDizzyMC/linx-server.git
synced 2026-01-23 02:14:33 +00:00
Serve file directly for curl and wget user agents (#145)
* Serve file directly for curl and wget user agents Fix #127 * Add test for get with wget user agent * Add -nodirectagents flag to disable serving files directly for wget/curl user agents * Fix TestPutAndGetCLI failing for Go 1.5 It failed because it doesn't include the Content-Type header for every response.
This commit is contained in:
parent
7c024d9aab
commit
5d8a0ef605
3 changed files with 58 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ var Config struct {
|
|||
remoteAuthFile string
|
||||
addHeaders headerList
|
||||
googleShorterAPIKey string
|
||||
noDirectAgents bool
|
||||
}
|
||||
|
||||
var Templates = make(map[string]*pongo2.Template)
|
||||
|
|
@ -243,6 +244,8 @@ func main() {
|
|||
"Add an arbitrary header to the response. This option can be used multiple times.")
|
||||
flag.StringVar(&Config.googleShorterAPIKey, "googleapikey", "",
|
||||
"API Key for Google's URL Shortener.")
|
||||
flag.BoolVar(&Config.noDirectAgents, "nodirectagents", false,
|
||||
"disable serving files directly for wget/curl user agents")
|
||||
|
||||
iniflags.Parse()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue