diff --git a/sumdb/server.go b/sumdb/server.go index a4f8bee..28866f1 100644 --- a/sumdb/server.go +++ b/sumdb/server.go @@ -80,17 +80,17 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { escPath, escVers := mod[:i], mod[i+1:] path, err := module.UnescapePath(escPath) if err != nil { - reportError(w, r, err) + reportError(w, err) return } vers, err := module.UnescapeVersion(escVers) if err != nil { - reportError(w, r, err) + reportError(w, err) return } id, err := s.ops.Lookup(ctx, module.Version{Path: path, Version: vers}) if err != nil { - reportError(w, r, err) + reportError(w, err) return } records, err := s.ops.ReadRecords(ctx, id, 1) @@ -137,7 +137,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { start := t.N << uint(t.H) records, err := s.ops.ReadRecords(ctx, start, int64(t.W)) if err != nil { - reportError(w, r, err) + reportError(w, err) return } if len(records) != t.W { @@ -159,7 +159,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { data, err := s.ops.ReadTileData(ctx, t) if err != nil { - reportError(w, r, err) + reportError(w, err) return } w.Header().Set("Content-Type", "application/octet-stream") @@ -172,7 +172,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Otherwise it is an internal server error. // The caller must only call reportError in contexts where // a not-found err should be reported as 404. -func reportError(w http.ResponseWriter, r *http.Request, err error) { +func reportError(w http.ResponseWriter, err error) { if os.IsNotExist(err) { http.Error(w, err.Error(), http.StatusNotFound) return