strip a single trailing slash from admin url

This commit is contained in:
Ben Irvin 2023-03-29 08:53:06 +02:00
parent 49d32d001b
commit 7fbad9fb9d
2 changed files with 8 additions and 2 deletions

View File

@ -210,7 +210,10 @@ class RemoteStrapiDestinationProvider implements IDestinationProvider {
});
}
const wsProtocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${wsProtocol}//${url.host}${url.pathname}${TRANSFER_PATH}/push`;
const wsUrl = `${wsProtocol}//${url.host}${url.pathname.replace(
/\/$/,
''
)}${TRANSFER_PATH}/push`;
// No auth defined, trying public access for transfer
if (!auth) {

View File

@ -227,7 +227,10 @@ class RemoteStrapiSourceProvider implements ISourceProvider {
let ws: WebSocket;
this.assertValidProtocol(url);
const wsProtocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${wsProtocol}//${url.host}${url.pathname}${TRANSFER_PATH}/pull`;
const wsUrl = `${wsProtocol}//${url.host}${url.pathname.replace(
/\/$/,
''
)}${TRANSFER_PATH}/pull`;
// No auth defined, trying public access for transfer
if (!auth) {