(w http.ResponseWriter, o interface{})
| 39 | } |
| 40 | |
| 41 | func (mod *RestAPI) toJSON(w http.ResponseWriter, o interface{}) { |
| 42 | w.Header().Set("Content-Type", "application/json") |
| 43 | if err := json.NewEncoder(w).Encode(o); err != nil { |
| 44 | mod.Debug("error while encoding object to JSON: %v", err) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func (mod *RestAPI) setSecurityHeaders(w http.ResponseWriter) { |
| 49 | w.Header().Add("X-Frame-Options", "DENY") |