Skip to content

Commit 712e199

Browse files
authored
Merge pull request #52 from fiatjaf/fix/imgproxy-invalid-token-404
Reject malformed imgproxy tokens with 404 instead of proxying empty URL
2 parents 2525e61 + 889fdf8 commit 712e199

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

imgproxy/handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ func pageHandler(w http.ResponseWriter, r *http.Request) {
118118
}
119119

120120
imgproxyURL = "http://imgproxy/insecure" + path
121+
} else {
122+
// malformed token: reject instead of forwarding an empty URL
123+
http.NotFound(w, r)
124+
return
121125
}
122126

123127
resp, err := imgproxySocketClient.Get(imgproxyURL)

0 commit comments

Comments
 (0)