MCPcopy
hub / github.com/writefreely/writefreely / processCollectionRequest

Function processCollectionRequest

collections.go:708–717  ·  view source on GitHub ↗
(cr *collectionReq, vars map[string]string, w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

706}
707
708func processCollectionRequest(cr *collectionReq, vars map[string]string, w http.ResponseWriter, r *http.Request) error {
709 cr.prefix = vars["prefix"]
710 cr.alias = vars["collection"]
711 // Normalize the URL, redirecting user to consistent post URL
712 if cr.alias != strings.ToLower(cr.alias) {
713 return impart.HTTPError{http.StatusMovedPermanently, fmt.Sprintf("/%s/", strings.ToLower(cr.alias))}
714 }
715
716 return nil
717}
718
719// processCollectionPermissions checks the permissions for the given
720// collectionReq, returning a Collection if access is granted; otherwise this

Callers 5

viewCollectionPostFunction · 0.85
handleViewCollectionFunction · 0.85
handleViewCollectionTagFunction · 0.85
handleViewCollectionLangFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected