changed handling of images slightly
This commit is contained in:
parent
29b7e17323
commit
ddf4b8fad5
@ -104,6 +104,7 @@ func (h Handler) Picture(resp http.ResponseWriter, path []string) {
|
|||||||
InternalError(resp)
|
InternalError(resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer img.Close()
|
||||||
|
|
||||||
decodedImg, err := jpeg.Decode(img)
|
decodedImg, err := jpeg.Decode(img)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -260,5 +261,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Println("start serving on:", *addr)
|
log.Println("start serving on:", *addr)
|
||||||
log.Fatal(http.ListenAndServe(*addr, Handler{conn, cache.New(cache.NoExpiration, 0)}))
|
log.Fatal(http.ListenAndServe(*addr, Handler{
|
||||||
|
Connection: conn,
|
||||||
|
cache: cache.New(cache.NoExpiration, 0),
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user