mirror of
https://github.com/willnorris/imageproxy.git
synced 2025-01-20 22:53:00 -05:00
Disallow anything with svg in the content-type header
This commit is contained in:
parent
fc97bd1862
commit
6ed3117053
1 changed files with 1 additions and 1 deletions
|
@ -239,7 +239,7 @@ func (p *Proxy) serveImage(w http.ResponseWriter, r *http.Request) {
|
||||||
resp.Body = ioutil.NopCloser(b)
|
resp.Body = ioutil.NopCloser(b)
|
||||||
contentType = peekContentType(b)
|
contentType = peekContentType(b)
|
||||||
}
|
}
|
||||||
if resp.ContentLength != 0 && !contentTypeMatches(p.ContentTypes, contentType) {
|
if (resp.ContentLength != 0 && !contentTypeMatches(p.ContentTypes, contentType)) || strings.Contains(contentType, "svg") {
|
||||||
p.logf("content-type not allowed: %q", contentType)
|
p.logf("content-type not allowed: %q", contentType)
|
||||||
http.Error(w, msgNotAllowed, http.StatusForbidden)
|
http.Error(w, msgNotAllowed, http.StatusForbidden)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue