Get host from client and put it in the attachments URL (only the web vault works without indicating the host in the URL)

This commit is contained in:
Daniel García
2018-02-15 01:49:36 +01:00
parent 912901780e
commit 47a116bbee
5 changed files with 19 additions and 15 deletions

View File

@@ -29,10 +29,10 @@ impl Attachment {
format!("{}/{}/{}", CONFIG.attachments_folder, self.cipher_uuid, self.id)
}
pub fn to_json(&self) -> JsonValue {
pub fn to_json(&self, host: &str) -> JsonValue {
use util::get_display_size;
let web_path = format!("/attachments/{}/{}", self.cipher_uuid, self.id);
let web_path = format!("{}/attachments/{}/{}", host, self.cipher_uuid, self.id);
let display_size = get_display_size(self.file_size);
json!({