From 44a0d097c099d9f6c1006738c5341472b5714fdc Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Tue, 16 Sep 2014 22:17:55 +0200 Subject: [PATCH] If we can't stat a base tile we can't deliver a sub tile -> 404. --- cmd/mtwebmapper/main.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/mtwebmapper/main.go b/cmd/mtwebmapper/main.go index c1178d8..90bddcd 100644 --- a/cmd/mtwebmapper/main.go +++ b/cmd/mtwebmapper/main.go @@ -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