1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-03-17 20:17:48 +02:00
This commit is contained in:
DarthSim 2018-10-06 03:01:54 +06:00
parent 776f57d003
commit 7b9a32d700
2 changed files with 3 additions and 7 deletions

View File

@ -8,14 +8,14 @@ import (
) )
var ( var (
errInvalidToken = errors.New("Invalid token") errInvalidToken = errors.New("Invalid token")
errInvalidURLEncoding = errors.New("Invalid token encoding") errInvalidTokenEncoding = errors.New("Invalid token encoding")
) )
func validatePath(token, path string) error { func validatePath(token, path string) error {
messageMAC, err := base64.RawURLEncoding.DecodeString(token) messageMAC, err := base64.RawURLEncoding.DecodeString(token)
if err != nil { if err != nil {
return errInvalidURLEncoding return errInvalidTokenEncoding
} }
mac := hmac.New(sha256.New, conf.Key) mac := hmac.New(sha256.New, conf.Key)

View File

@ -95,10 +95,6 @@ func shutdownVips() {
C.vips_shutdown() C.vips_shutdown()
} }
func round(f float64) int {
return int(f + .5)
}
func extractMeta(img *C.VipsImage) (int, int, int, bool) { func extractMeta(img *C.VipsImage) (int, int, int, bool) {
width := int(img.Xsize) width := int(img.Xsize)
height := int(img.Ysize) height := int(img.Ysize)