+5
knotserver/jetstream.go
+5
knotserver/jetstream.go
···
86
86
}
87
87
defer resp.Body.Close()
88
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
+
89
94
plaintext, err := io.ReadAll(resp.Body)
90
95
if err != nil {
91
96
l.Error("error reading response body", "error", err)