ListLinks returns a list of the current user's links
(c web.C, w http.ResponseWriter, r *http.Request)
| 58 | |
| 59 | // ListLinks returns a list of the current user's links |
| 60 | func ListLinks(c web.C, w http.ResponseWriter, r *http.Request) { |
| 61 | account := r.Header.Get("X-Remote-User") |
| 62 | for _, l := range links { |
| 63 | if l.Owner == account { |
| 64 | fmt.Fprintf(w, "%s\n", l.ShortLink) |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | var ( |
| 70 | key = []byte(`-----BEGIN RSA PRIVATE KEY----- |