Function
parseJSON
(r *http.Request, dst interface{})
Source from the content-addressed store, hash-verified
| 72 | } |
| 73 | |
| 74 | func parseJSON(r *http.Request, dst interface{}) error { |
| 75 | dec := json.NewDecoder(r.Body) |
| 76 | |
| 77 | if err := dec.Decode(dst); err != nil { |
| 78 | return err |
| 79 | } |
| 80 | |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | // GetCredential extracts a session key from the request from the request header. Concretely, |
| 85 | // it first looks at the 'Cookie' and then the 'Authorization' header. If no credential is found, |
Tested by
no test coverage detected