mirror of
https://github.com/tenox7/wrp.git
synced 2025-04-07 00:37:10 +00:00
if to switch to improve readability
This commit is contained in:
parent
2c2fbd11a6
commit
69efa1fb92
5
wrp.go
5
wrp.go
@ -224,9 +224,10 @@ func imgServer(out http.ResponseWriter, req *http.Request) {
|
||||
if !nodel {
|
||||
defer delete(img, req.URL.Path)
|
||||
}
|
||||
if strings.HasPrefix(req.URL.Path, ".gif") {
|
||||
switch {
|
||||
case strings.HasPrefix(req.URL.Path, ".gif"):
|
||||
out.Header().Set("Content-Type", "image/gif")
|
||||
} else if strings.HasPrefix(req.URL.Path, ".png") {
|
||||
case strings.HasPrefix(req.URL.Path, ".png"):
|
||||
out.Header().Set("Content-Type", "image/png")
|
||||
}
|
||||
out.Header().Set("Content-Length", strconv.Itoa(len(imgbuf.Bytes())))
|
||||
|
Loading…
x
Reference in New Issue
Block a user