MCPcopy Create free account
hub / github.com/crewjam/saml / ServeLink

Function ServeLink

example/service.go:49–57  ·  view source on GitHub ↗

ServeLink handles requests to redirect to a link

(c web.C, w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

47
48// ServeLink handles requests to redirect to a link
49func ServeLink(c web.C, w http.ResponseWriter, r *http.Request) {
50 l, ok := links[strings.TrimPrefix(r.URL.Path, "/")]
51 if !ok {
52 http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
53 return
54 }
55 http.Redirect(w, r, l.Target, http.StatusFound)
56 return
57}
58
59// ListLinks returns a list of the current user's links
60func ListLinks(c web.C, w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

ErrorMethod · 0.45
RedirectMethod · 0.45

Tested by

no test coverage detected