Skip to content

Commit 41220d1

Browse files
committed
Remove trailing slash from API urls
1 parent 29f01c5 commit 41220d1

21 files changed

+21
-21
lines changed

tasks/add-member-comp-subscription.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const initialise = (options) => {
1313
delayBetweenCalls: 50
1414
};
1515

16-
const url = options.apiURL;
16+
const url = options.apiURL.replace(/\/$/, '');
1717
const key = options.adminAPIKey;
1818
const api = new GhostAdminAPI({
1919
url: url.replace('localhost', '127.0.0.1'),

tasks/add-member-newsletter-subscription.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const initialise = (options) => {
1313
delayBetweenCalls: 50
1414
};
1515

16-
const url = options.apiURL;
16+
const url = options.apiURL.replace(/\/$/, '');
1717
const key = options.adminAPIKey;
1818
const api = new GhostAdminAPI({
1919
url: url.replace('localhost', '127.0.0.1'),

tasks/add-preview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const initialise = (options) => {
1616
delayBetweenCalls: 50
1717
};
1818

19-
const url = options.apiURL;
19+
const url = options.apiURL.replace(/\/$/, '');
2020
const key = options.adminAPIKey;
2121
const api = new GhostAdminAPI({
2222
url: url.replace('localhost', '127.0.0.1'),

tasks/add-tags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const initialise = (options) => {
1616
delayBetweenCalls: 50
1717
};
1818

19-
const url = options.apiURL;
19+
const url = options.apiURL.replace(/\/$/, '');
2020
const key = options.adminAPIKey;
2121
const api = new GhostAdminAPI({
2222
url: url.replace('localhost', '127.0.0.1'),

tasks/change-author.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const initialise = (options) => {
1515
delayBetweenCalls: 50
1616
};
1717

18-
const url = options.apiURL;
18+
const url = options.apiURL.replace(/\/$/, '');
1919
const key = options.adminAPIKey;
2020
const api = new GhostAdminAPI({
2121
url: url.replace('localhost', '127.0.0.1'),

tasks/change-role.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const initialise = (options) => {
1515
delayBetweenCalls: 50
1616
};
1717

18-
const url = options.apiURL;
18+
const url = options.apiURL.replace(/\/$/, '');
1919
const key = options.adminAPIKey;
2020
const api = new GhostAdminAPI({
2121
url: url.replace('localhost', '127.0.0.1'),

tasks/change-status.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const initialise = (options) => {
1515
delayBetweenCalls: 50
1616
};
1717

18-
const url = options.apiURL;
18+
const url = options.apiURL.replace(/\/$/, '');
1919
const key = options.adminAPIKey;
2020
const api = new GhostAdminAPI({
2121
url: url.replace('localhost', '127.0.0.1'),

tasks/change-tags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const initialise = (options) => {
1616
delayBetweenCalls: 50
1717
};
1818

19-
const url = options.apiURL;
19+
const url = options.apiURL.replace(/\/$/, '');
2020
const key = options.adminAPIKey;
2121
const api = new GhostAdminAPI({
2222
url: url.replace('localhost', '127.0.0.1'),

tasks/change-visibility-pages.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const initialise = (options) => {
1515
delayBetweenCalls: 50
1616
};
1717

18-
const url = options.apiURL;
18+
const url = options.apiURL.replace(/\/$/, '');
1919
const key = options.adminAPIKey;
2020
const api = new GhostAdminAPI({
2121
url: url.replace('localhost', '127.0.0.1'),

tasks/change-visibility-posts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const initialise = (options) => {
1515
delayBetweenCalls: 50
1616
};
1717

18-
const url = options.apiURL;
18+
const url = options.apiURL.replace(/\/$/, '');
1919
const key = options.adminAPIKey;
2020
const api = new GhostAdminAPI({
2121
url: url.replace('localhost', '127.0.0.1'),

tasks/combine-tags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const initialise = (options) => {
1616
delayBetweenCalls: 50
1717
};
1818

19-
const url = options.apiURL;
19+
const url = options.apiURL.replace(/\/$/, '');
2020
const key = options.adminAPIKey;
2121
const api = new GhostAdminAPI({
2222
url: url.replace('localhost', '127.0.0.1'),

tasks/content-stats.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const initialise = (options) => {
66
return {
77
title: 'Initialising API connection',
88
task: async (ctx, task) => {
9-
const url = options.apiURL;
9+
const url = options.apiURL.replace(/\/$/, '');
1010
const key = options.adminAPIKey;
1111
const api = new GhostAdminAPI({
1212
url: url.replace('localhost', '127.0.0.1'),

tasks/delete-pages.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const initialise = (options) => {
1616
delayBetweenCalls: 50
1717
};
1818

19-
const url = options.apiURL;
19+
const url = options.apiURL.replace(/\/$/, '');
2020
const key = options.adminAPIKey;
2121
const api = new GhostAdminAPI({
2222
url: url.replace('localhost', '127.0.0.1'),

tasks/delete-posts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const initialise = (options) => {
1616
delayBetweenCalls: 50
1717
};
1818

19-
const url = options.apiURL;
19+
const url = options.apiURL.replace(/\/$/, '');
2020
const key = options.adminAPIKey;
2121
const api = new GhostAdminAPI({
2222
url: url.replace('localhost', '127.0.0.1'),

tasks/delete-tags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const initialise = (options) => {
1414
delayBetweenCalls: 50
1515
};
1616

17-
const url = options.apiURL;
17+
const url = options.apiURL.replace(/\/$/, '');
1818
const key = options.adminAPIKey;
1919
const api = new GhostAdminAPI({
2020
url: url.replace('localhost', '127.0.0.1'),

tasks/delete-unused-tags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const initialise = (options) => {
1414
delayBetweenCalls: 50
1515
};
1616

17-
const url = options.apiURL;
17+
const url = options.apiURL.replace(/\/$/, '');
1818
const key = options.adminAPIKey;
1919
const api = new GhostAdminAPI({
2020
url: url.replace('localhost', '127.0.0.1'),

tasks/find-replace.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const initialise = (options) => {
1313
delayBetweenCalls: 50
1414
};
1515

16-
const url = options.apiURL;
16+
const url = options.apiURL.replace(/\/$/, '');
1717
const key = options.adminAPIKey;
1818
const api = new GhostAdminAPI({
1919
url: url.replace('localhost', '127.0.0.1'),

tasks/page-to-post.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const initialise = (options) => {
1313
delayBetweenCalls: 50
1414
};
1515

16-
const url = options.apiURL;
16+
const url = options.apiURL.replace(/\/$/, '');
1717
const key = options.adminAPIKey;
1818
const api = new GhostAdminAPI({
1919
url: url.replace('localhost', '127.0.0.1'),

tasks/post-tiers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const initialise = (options) => {
1313
delayBetweenCalls: 50
1414
};
1515

16-
const url = options.apiURL;
16+
const url = options.apiURL.replace(/\/$/, '');
1717
const key = options.adminAPIKey;
1818
const api = new GhostAdminAPI({
1919
url: url.replace('localhost', '127.0.0.1'),

tasks/random-posts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const initialise = (options) => {
2828
delayBetweenCalls: 50
2929
};
3030

31-
const url = options.apiURL;
31+
const url = options.apiURL.replace(/\/$/, '');
3232
const key = options.adminAPIKey;
3333
const api = new GhostAdminAPI({
3434
url: url.replace('localhost', '127.0.0.1'),

tasks/remove-member-comp-subscription.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const initialise = (options) => {
1313
delayBetweenCalls: 50
1414
};
1515

16-
const url = options.apiURL;
16+
const url = options.apiURL.replace(/\/$/, '');
1717
const key = options.adminAPIKey;
1818
const api = new GhostAdminAPI({
1919
url: url.replace('localhost', '127.0.0.1'),

0 commit comments

Comments
 (0)