Skip to content

Commit

Permalink
[Bugfix] Fixes a bug where tilenol writes to a disconnected client
Browse files Browse the repository at this point in the history
  • Loading branch information
jerluc committed Apr 1, 2024
1 parent 5481268 commit d1c7cf6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package tilenol

import (
"context"
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
"strconv"
"strings"
"syscall"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
Expand Down Expand Up @@ -383,6 +385,11 @@ func (s *Server) getVectorTile(w http.ResponseWriter, r *http.Request) {

// handleError is a helper function to generate a generic tile server error response
func (s *Server) handleError(err error, w http.ResponseWriter, r *http.Request) {
// Don't attempt to handle broken pipe errors (no one's listening on the other side!)
if errors.Is(err, syscall.EPIPE) {
return
}

var errCode int
switch err.(type) {
case InvalidRequestError:
Expand Down

0 comments on commit d1c7cf6

Please sign in to comment.