Check if mime type is text/gemini

This commit is contained in:
blank X 2021-08-10 00:35:24 +07:00
parent db05f5b473
commit ecf993bcc0
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 3 additions and 0 deletions

View File

@ -115,6 +115,9 @@ func main() {
if resp.Status.Class() != gemini.StatusSuccess {
log.Fatalf("%d %s", resp.Status, resp.Meta)
}
if resp.Meta != "text/gemini" && !strings.HasPrefix(resp.Meta, "text/gemini;") {
log.Fatal("mime type is not text/gemini")
}
aw := AtomWriter{
Title: "",
Items: nil,