Allow password entry for shared directories
This commit is contained in:
@@ -124,12 +124,20 @@ func (wc *WebController) metadataFromFilesystem(r *http.Request, f api.Filesyste
|
||||
}
|
||||
}
|
||||
|
||||
// The services which make link previews don't keep cookies, so a password
|
||||
// in the link has to be in every URL they open
|
||||
var query, thumbnail = "", "?thumbnail"
|
||||
if password := r.URL.Query().Get("password"); password != "" {
|
||||
password = "password=" + url.QueryEscape(password)
|
||||
query, thumbnail = "?"+password, thumbnail+"&"+password
|
||||
}
|
||||
|
||||
return generateOGData(
|
||||
base.Name,
|
||||
base.FileType,
|
||||
addr+"/d"+filepath,
|
||||
addr+"/api/filesystem"+filepath,
|
||||
addr+"/api/filesystem"+filepath+"?thumbnail",
|
||||
addr+"/d"+filepath+query,
|
||||
addr+"/api/filesystem"+filepath+query,
|
||||
addr+"/api/filesystem"+filepath+thumbnail,
|
||||
colour,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user