From 06ac266bbf8d9b7a329234ab4284607342b4662a Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Sun, 8 Sep 2019 09:55:25 +0700 Subject: [PATCH] Updated ShareX config --- public/js/s/utils.js | 16 ++++++++-------- public/safe.fiery.me.sxcu | 6 +++--- views/_globals.njk | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/public/js/s/utils.js b/public/js/s/utils.js index 3273821..4cc0b9f 100644 --- a/public/js/s/utils.js +++ b/public/js/s/utils.js @@ -4,12 +4,12 @@ lsKeys.siBytes = 'siBytes' page.prepareShareX = function () { - const values = { + const values = page.token ? { token: page.token || '', - albumid: page.album || '', - filelength: page.fileLength || '', - age: page.uploadAge || '' - } + albumid: page.album || '' + } : {} + values.filelength = page.filelength || '' + values.age = page.uploadAge || '' const headers = [] const keys = Object.keys(values) @@ -24,13 +24,13 @@ page.prepareShareX = function () { const sharexFile = `{ "Name": "${originClean}", "DestinationType": "ImageUploader, FileUploader", - "RequestType": "POST", + "RequestMethod": "POST", "RequestURL": "${location.protocol}//${origin}/api/upload", - "FileFormName": "files[]", "Headers": { ${headers.join(',\n')} }, - "ResponseType": "Text", + "Body": "MultipartFormData", + "FileFormName": "files[]", "URL": "$json:files[0].url$", "ThumbnailURL": "$json:files[0].url$" }` diff --git a/public/safe.fiery.me.sxcu b/public/safe.fiery.me.sxcu index 418215a..16bb39f 100644 --- a/public/safe.fiery.me.sxcu +++ b/public/safe.fiery.me.sxcu @@ -1,16 +1,16 @@ { "Name": "safe.fiery.me", "DestinationType": "ImageUploader, FileUploader", - "RequestType": "POST", + "RequestMethod": "POST", "RequestURL": "https://safe.fiery.me/api/upload", - "FileFormName": "files[]", "Headers": { "token": "", "albumid": "", "filelength": "", "age": "" }, - "ResponseType": "Text", + "Body": "MultipartFormData", + "FileFormName": "files[]", "URL": "$json:files[0].url$", "ThumbnailURL": "$json:files[0].url$" } \ No newline at end of file diff --git a/views/_globals.njk b/views/_globals.njk index ddc9c1d..041a85c 100644 --- a/views/_globals.njk +++ b/views/_globals.njk @@ -16,7 +16,7 @@ v3: CSS and JS files (libs such as bulma, lazyload, etc). v4: Renders in /public/render/* directories (to be used by render.js). #} -{% set v1 = "01mMpp1DzB" %} +{% set v1 = "gYwgjH5FFj" %} {% set v2 = "hiboQUzAzp" %} {% set v3 = "tWLiAlAX5i" %} {% set v4 = "S3TAWpPeFS" %}