mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 12:56:23 +02:00
content-type checking
This commit is contained in:
parent
74c16f575e
commit
39a4e1813d
3 changed files with 82 additions and 6 deletions
|
|
@ -51,6 +51,7 @@ var scaleUp = flag.Bool("scaleUp", false, "allow images to scale beyond their or
|
|||
var timeout = flag.Duration("timeout", 0, "time limit for requests served by this proxy")
|
||||
var verbose = flag.Bool("verbose", false, "print verbose logging messages")
|
||||
var version = flag.Bool("version", false, "Deprecated: this flag does nothing")
|
||||
var contentTypes = flag.String("contentTypes", "", "comma separated list of allowed content types")
|
||||
|
||||
func init() {
|
||||
flag.Var(&cache, "cache", "location to cache images (see https://github.com/willnorris/imageproxy#cache)")
|
||||
|
|
@ -66,6 +67,9 @@ func main() {
|
|||
if *referrers != "" {
|
||||
p.Referrers = strings.Split(*referrers, ",")
|
||||
}
|
||||
if *contentTypes != "" {
|
||||
p.ContentTypes = strings.Split(*contentTypes, ",")
|
||||
}
|
||||
if *signatureKey != "" {
|
||||
key := []byte(*signatureKey)
|
||||
if strings.HasPrefix(*signatureKey, "@") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue