lint: improve error handling

This commit is contained in:
Will Norris 2022-01-22 10:29:37 -08:00
parent ef8aec77a9
commit a81add5d96
6 changed files with 9 additions and 5 deletions

View file

@ -276,7 +276,7 @@ func (p *Proxy) serveImage(w http.ResponseWriter, r *http.Request) {
// the content type. Returns empty string if error occurs.
func peekContentType(p *bufio.Reader) string {
byt, err := p.Peek(512)
if err != nil && err != bufio.ErrBufferFull && err != io.EOF {
if err != nil && !errors.Is(err, bufio.ErrBufferFull) && !errors.Is(err, io.EOF) {
return ""
}
return http.DetectContentType(byt)