mirror of
https://github.com/pocketbase/pocketbase.git
synced 2024-11-25 01:16:21 +02:00
simplify the svg extension check
This commit is contained in:
parent
5d8fc939e2
commit
4c2cd5a534
@ -199,9 +199,8 @@ func (s *System) Serve(response http.ResponseWriter, fileKey string, name string
|
|||||||
// make an exception for svg and use a custom content type
|
// make an exception for svg and use a custom content type
|
||||||
// to send in the response so that it can be loaded in a img tag
|
// to send in the response so that it can be loaded in a img tag
|
||||||
// (see https://github.com/whatwg/mimesniff/issues/7)
|
// (see https://github.com/whatwg/mimesniff/issues/7)
|
||||||
ext := filepath.Ext(name)
|
|
||||||
extContentType := realContentType
|
extContentType := realContentType
|
||||||
if ext == ".svg" {
|
if filepath.Ext(name) == ".svg" {
|
||||||
extContentType = "image/svg+xml"
|
extContentType = "image/svg+xml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user