Skip to content

Commit

Permalink
Merge pull request #11 from grindlemire/master
Browse files Browse the repository at this point in the history
Don't trigger superfluous logs
  • Loading branch information
mvrilo authored Jan 19, 2024
2 parents e6245d7 + 100010e commit 7cdf2a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions redoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ func (r Redoc) Handler() http.HandlerFunc {
header := w.Header()
if strings.HasSuffix(req.URL.Path, r.SpecPath) {
header.Set("Content-Type", "application/json")
_, _ = w.Write(spec)
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
w.Write(spec)

Check failure on line 96 in redoc.go

View workflow job for this annotation

GitHub Actions / test

Error return value of `w.Write` is not checked (errcheck)
return
}

if docsPath == "" || docsPath == req.URL.Path {
header.Set("Content-Type", "text/html")
_, _ = w.Write(data)
w.WriteHeader(200)
w.WriteHeader(http.StatusOK)
w.Write(data)

Check failure on line 103 in redoc.go

View workflow job for this annotation

GitHub Actions / test

Error return value of `w.Write` is not checked (errcheck)
}
}
}

0 comments on commit 7cdf2a7

Please sign in to comment.