If we can't stat a base tile we can't deliver a sub tile -> 404.

This commit is contained in:
Sascha L. Teichmann 2014-09-16 22:17:55 +02:00
parent c42be33ba9
commit 44a0d097c0

View File

@ -117,17 +117,18 @@ func main() {
var err error
if ifNoneMatch := r.Header.Get("If-None-Match"); ifNoneMatch != "" {
if etag, err = createETag(baseTile); err == nil {
if ifNoneMatch == etag {
http.Error(rw, http.StatusText(http.StatusNotModified), http.StatusNotModified)
return
}
if etag, err = createETag(baseTile); err != nil {
http.NotFound(rw, r)
return
}
if ifNoneMatch == etag {
http.Error(rw, http.StatusText(http.StatusNotModified), http.StatusNotModified)
return
}
}
img := common.LoadPNG(baseTile)
type subImage interface {
image.Image
SubImage(image.Rectangle) image.Image
}
var si subImage