Fix mediaendpoint auth

master
Jan-Lukas Else 2020-01-10 11:14:47 +01:00
parent 9a41fb90b9
commit 2136265825
1 changed files with 2 additions and 2 deletions

View File

@ -28,8 +28,8 @@ func HandleMedia(w http.ResponseWriter, r *http.Request) {
return return
} }
authCode := r.Header.Get("authorization") authCode := r.Header.Get("authorization")
if formAuth := r.FormValue("authorization"); len(authCode) == 0 && len(formAuth) > 0 { if formAuth := r.FormValue("access_token"); len(authCode) == 0 && len(formAuth) > 0 {
authCode = formAuth authCode = "Bearer " + formAuth
} }
if CheckAuthorization(authCode) { if CheckAuthorization(authCode) {
file, header, err := r.FormFile("file") file, header, err := r.FormFile("file")