From fab9f13ff5500faee19664496ebdb252dad63b7d Mon Sep 17 00:00:00 2001 From: Kristian Polso Date: Fri, 15 Jun 2018 08:39:11 +0300 Subject: [PATCH] Change forward method to POST --- content/.vuepress/components/Step1.vue | 5 ++++- content/.vuepress/components/Step2.vue | 12 +++++++++++- content/.vuepress/components/Step3.vue | 6 +++++- server.js | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/content/.vuepress/components/Step1.vue b/content/.vuepress/components/Step1.vue index cc9bb26..9514436 100644 --- a/content/.vuepress/components/Step1.vue +++ b/content/.vuepress/components/Step1.vue @@ -100,7 +100,10 @@ export default { component.jsonData = ''; component.isLoading = true; component.exampleCode = '# Example code using the daemon\ncurl \'http://localhost:5279\' --data \'{"method":"resolve","params":{"uri":"' + this.address + '"}}\''; - this.$http.get('https://lbry.tech/forward?method=resolve&uri=' + this.address).then(function(response) { + this.$http.post('https://lbry.tech/forward', { + method: 'resolve', + uri: this.address + }).then(function(response) { component.isLoading = false; component.jsonData = JSON.stringify(response.body, null, ' '); }); diff --git a/content/.vuepress/components/Step2.vue b/content/.vuepress/components/Step2.vue index 0f4ffa5..06c7602 100644 --- a/content/.vuepress/components/Step2.vue +++ b/content/.vuepress/components/Step2.vue @@ -202,7 +202,17 @@ export default { component.isLoading = false; component.exampleCode = ''; } else { - component.$http.get('https://lbry.tech/forward?method=publish&name=' + component.title + '&bid=0.001&file_path=' + response.filename + '&title=' + component.title + '&description=' + component.description + '&language=' + component.language + '&license=' + component.license + '&nsfw=' + component.nsfw).then(function(response) { + component.$http.post('https://lbry.tech/forward', { + method: 'publish', + name: component.title, + bid: 0.001, + file_path: response.filename, + title: component.title, + description: component.description, + language: component.language, + license: component.license, + nsfw: component.nsfw + }).then(function(response) { component.isLoading = false; component.jsonData = JSON.stringify(response.body, null, ' '); EventBus.$emit('HookFileUploaded', response.body.txid); diff --git a/content/.vuepress/components/Step3.vue b/content/.vuepress/components/Step3.vue index 4ac1720..1ce6785 100644 --- a/content/.vuepress/components/Step3.vue +++ b/content/.vuepress/components/Step3.vue @@ -102,7 +102,11 @@ export default { component.jsonData = ''; component.isLoading = true; component.exampleCode = '# Example code using the daemon\ncurl \'http://localhost:5279\' --data \'{"method":"wallet_send","params":{"claim_id":"' + this.address + '","amount":' + this.amount + '}}\''; - this.$http.get('https://lbry.tech/forward?method=wallet_send&claim_id=' + this.address + '&amount=' + this.amount).then(function(response) { + this.$http.post('https://lbry.tech/forward', { + method: 'wallet_send', + claim_id: this.address, + amount: this.amount + }).then(function(response) { component.isLoading = false; component.jsonData = JSON.stringify(response.body, null, ' '); }); diff --git a/server.js b/server.js index 3c4e9e8..d747b93 100644 --- a/server.js +++ b/server.js @@ -47,7 +47,7 @@ var textParser = bodyParser.text({ limit: '256kb' }); -app.get('/forward', function(req, res) { +app.post('/forward', function(req, res) { var allowedMethods = ["wallet_send", "resolve", "publish"];