remove url from data

test
dan 2020-03-29 21:36:19 -06:00
parent 6394385986
commit 3970ccd93f
2 changed files with 4 additions and 13 deletions

View File

@ -34,8 +34,7 @@ export class ImageComponent implements OnInit {
imageWidth: 750, imageWidth: 750,
imageHeight: 404, imageHeight: 404,
title: 'Coronavirus Anxiety?', title: 'Coronavirus Anxiety?',
description: 'The cure for coronavirus anxiety', description: 'The cure for coronavirus anxiety'
url: baseUrl + '/covid'
} }
}; };
let dialog = this.dialog.open(SharePopupComponent, opts); let dialog = this.dialog.open(SharePopupComponent, opts);

View File

@ -41,7 +41,7 @@ function getOther(req, res, param) {
userAgent === 'Facebot' || userAgent === 'Facebot' ||
userAgent.startsWith('Twitterbot') || userAgent.startsWith('Twitterbot') ||
referrer.startsWith('http://opengraphcheck.com')) { 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 { } else {
var url = params.url || (req.protocol + "://" + req.hostname); var url = params.url || (req.protocol + "://" + req.hostname);
res.redirect(url); 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; imageWidth = imageWidth || 200;
imageHeight = imageHeight || 200; imageHeight = imageHeight || 200;
const data = { const url = req.protocol + '://' + reqhostname + req.originalUrl;
title: title,
description: description,
imageUrl: imageUrl,
imageWidth: imageWidth,
imageHeight: imageHeight,
url: url
};
url = req.protocol + '://' + req.hostname + otherUrl + encodeURIComponent(JSON.stringify(data));
var result = `<html> var result = `<html>
<head> <head>
<title>Old Fashion Baptist Church</title> <title>Old Fashion Baptist Church</title>