MCPcopy
hub / github.com/writefreely/writefreely / isRaw

Function isRaw

posts.go:1447–1457  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

1445}
1446
1447func isRaw(r *http.Request) bool {
1448 vars := mux.Vars(r)
1449 slug := vars["slug"]
1450
1451 // NOTE: until this is done better, be sure to keep this in parity with
1452 // isRaw in viewCollectionPost() and handleViewPost()
1453 isJSON := strings.HasSuffix(slug, ".json")
1454 isXML := strings.HasSuffix(slug, ".xml")
1455 isMarkdown := strings.HasSuffix(slug, ".md")
1456 return strings.HasSuffix(slug, ".txt") || isJSON || isXML || isMarkdown
1457}
1458
1459func viewCollectionPost(app *App, w http.ResponseWriter, r *http.Request) error {
1460 vars := mux.Vars(r)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected