fix #26
parent
09f4d90142
commit
109f27170a
|
@ -1,6 +1,7 @@
|
||||||
package browse
|
package browse
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -21,6 +22,6 @@ func ServeHTTP(w http.ResponseWriter, r *http.Request, c *config.Config) (int, e
|
||||||
case "GET":
|
case "GET":
|
||||||
return GET(w, r, c)
|
return GET(w, r, c)
|
||||||
default:
|
default:
|
||||||
return 400, nil
|
return 400, errors.New("Invalid method.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package editor
|
package editor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -18,6 +19,6 @@ func ServeHTTP(w http.ResponseWriter, r *http.Request, c *config.Config) (int, e
|
||||||
case "GET":
|
case "GET":
|
||||||
return GET(w, r, c, filename)
|
return GET(w, r, c, filename)
|
||||||
default:
|
default:
|
||||||
return 400, nil
|
return 400, errors.New("Invalid method.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ func parseFrontMatterOnlyFile(rawFile map[string]interface{}, filename string) (
|
||||||
case "yaml":
|
case "yaml":
|
||||||
mark = rune('-')
|
mark = rune('-')
|
||||||
default:
|
default:
|
||||||
return []byte{}, http.StatusBadRequest, errors.New("can't define the frontmatter")
|
return []byte{}, http.StatusBadRequest, errors.New("Can't define the frontmatter.")
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := parser.InterfaceToFrontMatter(rawFile, mark)
|
f, err := parser.InterfaceToFrontMatter(rawFile, mark)
|
||||||
|
|
Loading…
Reference in New Issue