1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-12-07 23:32:55 +02:00

Fix path parsing

This commit is contained in:
DarthSim
2018-10-08 13:42:08 +06:00
parent 4e2217d1b0
commit d4ca9af5be
2 changed files with 4 additions and 4 deletions

View File

@@ -624,7 +624,7 @@ func parsePathSimple(parts []string, acceptHeader string) (string, processingOpt
}
func parsePath(ctx context.Context, rctx *fasthttp.RequestCtx) (context.Context, error) {
path := string(rctx.RequestURI())
path := string(rctx.Path())
parts := strings.Split(strings.TrimPrefix(path, "/"), "/")
var acceptHeader string

View File

@@ -22,7 +22,7 @@ var (
authHeaderMust []byte
healthRequestURI = []byte("/health")
healthPath = []byte("/health")
serverMutex mutex
@@ -139,7 +139,7 @@ func serveHTTP(rctx *fasthttp.RequestCtx) {
}
}()
log.Printf("[%s] %s: %s\n", reqID, rctx.Method(), rctx.RequestURI())
log.Printf("[%s] %s: %s\n", reqID, rctx.Method(), rctx.Path())
writeCORS(rctx)
@@ -159,7 +159,7 @@ func serveHTTP(rctx *fasthttp.RequestCtx) {
serverMutex.Lock()
defer serverMutex.Unock()
if bytes.Equal(rctx.RequestURI(), healthRequestURI) {
if bytes.Equal(rctx.Path(), healthPath) {
rctx.SetStatusCode(200)
rctx.SetBodyString("imgproxy is running")
return