mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 04:46:24 +02:00
use gorilla/mux for routing requests
Thanks to @Fieldistor for the reminder that gorilla/mux allows you to disable cleaning request URLs, which was causing problems with signature verification for some URLs. Fixes #215 Fixes #212
This commit is contained in:
parent
00652fd9cb
commit
3589510f2c
3 changed files with 6 additions and 2 deletions
|
|
@ -31,6 +31,7 @@ import (
|
|||
"github.com/die-net/lrucache"
|
||||
"github.com/die-net/lrucache/twotier"
|
||||
"github.com/garyburd/redigo/redis"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/gregjones/httpcache/diskcache"
|
||||
rediscache "github.com/gregjones/httpcache/redis"
|
||||
"github.com/jamiealquiza/envy"
|
||||
|
|
@ -99,9 +100,10 @@ func main() {
|
|||
Handler: p,
|
||||
}
|
||||
|
||||
r := mux.NewRouter().SkipClean(true).UseEncodedPath()
|
||||
r.PathPrefix("/").Handler(p)
|
||||
fmt.Printf("imageproxy listening on %s\n", server.Addr)
|
||||
http.Handle("/", p)
|
||||
log.Fatal(http.ListenAndServe(*addr, nil))
|
||||
log.Fatal(http.ListenAndServe(*addr, r))
|
||||
}
|
||||
|
||||
type signatureKeyList [][]byte
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue