aboutsummaryrefslogtreecommitdiff
path: root/response.go
diff options
context:
space:
mode:
Diffstat (limited to 'response.go')
-rw-r--r--response.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/response.go b/response.go
index 4b207e5..8f24419 100644
--- a/response.go
+++ b/response.go
@@ -9,7 +9,7 @@ import (
// Response is a Gemini response.
type Response struct {
- // Status represents the response status.
+ // Status contains the response status code.
Status Status
// Meta contains more information related to the response status.
@@ -21,7 +21,7 @@ type Response struct {
// Body contains the response body for successful responses.
Body io.ReadCloser
- // Request is the request that was sent to obtain this Response.
+ // Request is the request that was sent to obtain this response.
Request *Request
// TLS contains information about the TLS connection on which the response
@@ -68,6 +68,10 @@ func (resp *Response) read(rc io.ReadCloser) error {
if len(meta) > 1024 {
return ErrInvalidResponse
}
+ // Default mime type of text/gemini; charset=utf-8
+ if statusClass == StatusClassSuccess && meta == "" {
+ meta = "text/gemini; charset=utf-8"
+ }
resp.Meta = meta
// Read terminating newline