Skip to content

Commit

Permalink
Use bytes.NewReader
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama committed Jan 22, 2025
1 parent 0cd8214 commit ccec73a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/web/ca_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"bytes"
"fmt"
"net/http"
"strings"
"time"

"github.com/gravitational/trace"
Expand Down Expand Up @@ -82,7 +81,7 @@ func (h *Handler) authExportPublicError(w http.ResponseWriter, r *http.Request,

// ServeContent sets the correct headers: Content-Type, Content-Length and Accept-Ranges.
// It also handles the Range negotiation
reader := strings.NewReader(string(authorities[0].Data))
reader := bytes.NewReader(authorities[0].Data)
http.ServeContent(w, r, "authorized_hosts.txt", time.Now(), reader)
return nil
}
Expand Down

0 comments on commit ccec73a

Please sign in to comment.