From 3970ccd93fa39171a3ccc608ab0e292d3f44d913 Mon Sep 17 00:00:00 2001 From: dan Date: Sun, 29 Mar 2020 21:36:19 -0600 Subject: [PATCH] remove url from data --- Client/src/app/components/image/image.component.ts | 3 +-- Server/src/routes/api/share.js | 14 +++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Client/src/app/components/image/image.component.ts b/Client/src/app/components/image/image.component.ts index 1569d22..17e4d8d 100644 --- a/Client/src/app/components/image/image.component.ts +++ b/Client/src/app/components/image/image.component.ts @@ -34,8 +34,7 @@ export class ImageComponent implements OnInit { imageWidth: 750, imageHeight: 404, title: 'Coronavirus Anxiety?', - description: 'The cure for coronavirus anxiety', - url: baseUrl + '/covid' + description: 'The cure for coronavirus anxiety' } }; let dialog = this.dialog.open(SharePopupComponent, opts); diff --git a/Server/src/routes/api/share.js b/Server/src/routes/api/share.js index aa8b620..8cf411b 100644 --- a/Server/src/routes/api/share.js +++ b/Server/src/routes/api/share.js @@ -41,7 +41,7 @@ function getOther(req, res, param) { userAgent === 'Facebot' || userAgent.startsWith('Twitterbot') || referrer.startsWith('http://opengraphcheck.com')) { - getOtherMeta(req, res, params.title, params.description, params.imageUrl, params.imageWidth, params.imageHeight, params.url); + getOtherMeta(req, res, params.title, params.description, params.imageUrl, params.imageWidth, params.imageHeight); } else { var url = params.url || (req.protocol + "://" + req.hostname); res.redirect(url); @@ -65,18 +65,10 @@ function getSermon(req, res, id){ } } -function getOtherMeta(req, res, title, description, imageUrl, imageWidth, imageHeight, url) { +function getOtherMeta(req, res, title, description, imageUrl, imageWidth, imageHeight) { imageWidth = imageWidth || 200; imageHeight = imageHeight || 200; - const data = { - title: title, - description: description, - imageUrl: imageUrl, - imageWidth: imageWidth, - imageHeight: imageHeight, - url: url - }; - url = req.protocol + '://' + req.hostname + otherUrl + encodeURIComponent(JSON.stringify(data)); + const url = req.protocol + '://' + reqhostname + req.originalUrl; var result = ` Old Fashion Baptist Church