From adcf2b4e46d8bed38099fecf23da666ae2bc056a Mon Sep 17 00:00:00 2001 From: Hippo Date: Mon, 26 Jul 2021 23:19:05 +0530 Subject: [PATCH] Respect baseUrl while pushing to Ghost --- static/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/app.js b/static/app.js index ae6a133..4603b63 100644 --- a/static/app.js +++ b/static/app.js @@ -97,11 +97,12 @@ function mediumFetch(e) { function ghostPush(e) { if(e) { e.preventDefault() } + const baseUrl = document.querySelector('[data-seance-url]').dataset.seanceUrl let postSlug = document.querySelector('[data-post-slug]').dataset.postSlug var password = document.querySelector('input[name=password]').value console.log('Pushing ' + postSlug) const socketProtocol = (window.location.protocol === 'https:' ? 'wss:' : 'ws:') - const socketUrl = socketProtocol + '//' + window.location.host + '/ws/push-ghost/' + const socketUrl = socketProtocol + '//' + baseUrl + '/ws/push-ghost/' const socket = new WebSocket(socketUrl) // set up the div