+8
-8
src/pages.go
+8
-8
src/pages.go
···
244
entryPath := sitePath
245
entry := (*Entry)(nil)
246
appliedRedirect := false
247
-
status := 200
248
reader := io.ReadSeeker(nil)
249
mtime := time.Time{}
250
for {
···
276
}
277
}
278
if entry == nil || entry.GetType() == Type_InvalidEntry {
279
-
status = 404
280
if entryPath != notFoundPage {
281
entryPath = notFoundPage
282
continue
···
832
err := error(nil)
833
switch r.Method {
834
// REST API
835
-
case http.MethodOptions:
836
// no preflight options
837
-
case http.MethodHead, http.MethodGet:
838
err = getPage(w, r)
839
-
case http.MethodPut:
840
err = putPage(w, r)
841
-
case http.MethodPatch:
842
err = patchPage(w, r)
843
-
case http.MethodDelete:
844
err = deletePage(w, r)
845
// webhook API
846
-
case http.MethodPost:
847
err = postPage(w, r)
848
default:
849
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
···
244
entryPath := sitePath
245
entry := (*Entry)(nil)
246
appliedRedirect := false
247
+
status := http.StatusOK
248
reader := io.ReadSeeker(nil)
249
mtime := time.Time{}
250
for {
···
276
}
277
}
278
if entry == nil || entry.GetType() == Type_InvalidEntry {
279
+
status = http.StatusNotFound
280
if entryPath != notFoundPage {
281
entryPath = notFoundPage
282
continue
···
832
err := error(nil)
833
switch r.Method {
834
// REST API
835
+
case "OPTIONS":
836
// no preflight options
837
+
case "HEAD", "GET":
838
err = getPage(w, r)
839
+
case "PUT":
840
err = putPage(w, r)
841
+
case "PATCH":
842
err = patchPage(w, r)
843
+
case "DELETE":
844
err = deletePage(w, r)
845
// webhook API
846
+
case "POST":
847
err = postPage(w, r)
848
default:
849
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)