fix some api key stuff

This commit is contained in:
Wim Brand
2020-02-21 14:09:13 +01:00
parent 7a67d8c33f
commit 4de17609bb
7 changed files with 21 additions and 14 deletions

View File

@@ -23,9 +23,10 @@ func (wc *WebController) serveFilePreview(w http.ResponseWriter, r *http.Request
return
}
apikey, _ := wc.getAPIKey(r)
api := pixelapi.New(wc.apiURLInternal, apikey)
api := pixelapi.New(wc.apiURLInternal)
api.APIKey, _ = wc.getAPIKey(r)
api.RealIP = util.RemoteAddress(r)
file, err := api.GetFileInfo(p.ByName("id")) // TODO: Error handling
if err != nil {
wc.serveNotFound(w, r)