+5
knotserver/jetstream.go
+5
knotserver/jetstream.go
···
86
}
87
defer resp.Body.Close()
88
89
+
if ct := resp.Header.Get("Content-Type"); !strings.HasPrefix(ct, "text/plain") {
90
+
l.Error("unexpected content type", "content-type", ct)
91
+
return fmt.Errorf("unexpected content type: %s", ct)
92
+
}
93
+
94
plaintext, err := io.ReadAll(resp.Body)
95
if err != nil {
96
l.Error("error reading response body", "error", err)