2020-10-24 13:15:32 -06:00
|
|
|
package gemini
|
2020-09-25 17:09:49 -06:00
|
|
|
|
2020-09-26 14:52:14 -06:00
|
|
|
import (
|
2020-10-13 18:10:04 -06:00
|
|
|
"errors"
|
2021-02-24 12:28:47 -07:00
|
|
|
"mime"
|
2020-09-26 14:52:14 -06:00
|
|
|
)
|
|
|
|
|
2021-02-24 12:27:49 -07:00
|
|
|
func init() {
|
|
|
|
// Add Gemini mime types
|
|
|
|
mime.AddExtensionType(".gmi", "text/gemini")
|
|
|
|
mime.AddExtensionType(".gemini", "text/gemini")
|
|
|
|
}
|
|
|
|
|
2020-10-27 17:21:33 -06:00
|
|
|
var crlf = []byte("\r\n")
|
2020-09-25 17:09:49 -06:00
|
|
|
|
2020-10-13 18:10:04 -06:00
|
|
|
// Errors.
|
|
|
|
var (
|
2020-12-17 23:41:14 -07:00
|
|
|
ErrInvalidRequest = errors.New("gemini: invalid request")
|
2020-11-05 13:27:12 -07:00
|
|
|
ErrInvalidResponse = errors.New("gemini: invalid response")
|
2021-02-14 21:58:28 -07:00
|
|
|
|
2021-02-21 07:27:12 -07:00
|
|
|
ErrCertificateExpired = errors.New("gemini: certificate expired")
|
|
|
|
|
2021-02-14 21:58:28 -07:00
|
|
|
// ErrBodyNotAllowed is returned by ResponseWriter.Write calls
|
|
|
|
// when the response status code does not permit a body.
|
|
|
|
ErrBodyNotAllowed = errors.New("gemini: response status code does not allow body")
|
2020-10-13 18:10:04 -06:00
|
|
|
)
|