You've already forked imgproxy
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user