Skip to content

Commit

Permalink
feat: set content length for tile responses (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
mogita authored Dec 24, 2024
1 parent 8687eae commit b525551
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handlers/tileset.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,12 @@ func (ts *Tileset) tileHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Encoding", "gzip")
}

w.Header().Set("Content-Length", fmt.Sprintf("%d", len(data)))

_, err = w.Write(data)

if err != nil && !errors.Is(err, syscall.EPIPE) && !errors.Is(err, syscall.EPROTOTYPE) {
ts.svc.logError("Could not write tile data for %v: %v", r.URL.Path, err)

}
}

Expand Down

0 comments on commit b525551

Please sign in to comment.