Add flag for respecting Forwarded header to allow sitting behind proxies
This commit is contained in:
parent
015ae39d18
commit
a2a8c5ec86
|
@ -44,6 +44,7 @@ var s3Bucket string
|
||||||
var hooksDir string
|
var hooksDir string
|
||||||
var version bool
|
var version bool
|
||||||
var exposeMetrics bool
|
var exposeMetrics bool
|
||||||
|
var behindProxy bool
|
||||||
|
|
||||||
var stdout = log.New(os.Stdout, "[tusd] ", 0)
|
var stdout = log.New(os.Stdout, "[tusd] ", 0)
|
||||||
var stderr = log.New(os.Stderr, "[tusd] ", 0)
|
var stderr = log.New(os.Stderr, "[tusd] ", 0)
|
||||||
|
@ -69,6 +70,7 @@ func init() {
|
||||||
flag.StringVar(&hooksDir, "hooks-dir", "", "Directory to search for available hooks scripts")
|
flag.StringVar(&hooksDir, "hooks-dir", "", "Directory to search for available hooks scripts")
|
||||||
flag.BoolVar(&version, "version", false, "Print tusd version information")
|
flag.BoolVar(&version, "version", false, "Print tusd version information")
|
||||||
flag.BoolVar(&exposeMetrics, "expose-metrics", true, "Expose metrics about tusd usage")
|
flag.BoolVar(&exposeMetrics, "expose-metrics", true, "Expose metrics about tusd usage")
|
||||||
|
flag.BoolVar(&behindProxy, "behind-proxy", false, "Respect X-Forwarded-* and similar headers which may be set by proxies")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
@ -147,6 +149,7 @@ func main() {
|
||||||
MaxSize: maxSize,
|
MaxSize: maxSize,
|
||||||
BasePath: basepath,
|
BasePath: basepath,
|
||||||
StoreComposer: composer,
|
StoreComposer: composer,
|
||||||
|
RespectForwardedHeaders: behindProxy,
|
||||||
NotifyCompleteUploads: true,
|
NotifyCompleteUploads: true,
|
||||||
NotifyTerminatedUploads: true,
|
NotifyTerminatedUploads: true,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue