From 0e4111e4203964bcb98c922ba713e9502e9604c0 Mon Sep 17 00:00:00 2001 From: Eric Andrews Date: Wed, 16 Dec 2020 18:59:56 +0200 Subject: [PATCH 1/2] small fix to publishHttp --- src/rest/StreamEndpoints.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rest/StreamEndpoints.js b/src/rest/StreamEndpoints.js index 39a9fec7f..f6f2c376f 100644 --- a/src/rest/StreamEndpoints.js +++ b/src/rest/StreamEndpoints.js @@ -187,7 +187,7 @@ export async function publishHttp(streamObjectOrId, data, requestOptions = {}, k // Send data to the stream return authFetch( - `${this.options.restUrl}/streams/${streamId}/data`, + `${this.options.restUrl}/streams/${encodeURIComponent(streamId)}/data`, this.session, { ...requestOptions, From a675f20d9e5b46832fbcd19ff6a00e4d84705194 Mon Sep 17 00:00:00 2001 From: Tim Oxley Date: Wed, 10 Feb 2021 10:41:45 -0500 Subject: [PATCH 2/2] Use getEndpointUrl to automatically encode stream urls. --- src/rest/StreamEndpoints.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rest/StreamEndpoints.js b/src/rest/StreamEndpoints.js index f6f2c376f..700a94138 100644 --- a/src/rest/StreamEndpoints.js +++ b/src/rest/StreamEndpoints.js @@ -76,7 +76,7 @@ export async function createStream(props) { props, }) const json = await authFetch( - `${this.options.restUrl}/streams`, + getEndpointUrl(this.options.restUrl, 'streams'), this.session, { method: 'POST', @@ -187,7 +187,7 @@ export async function publishHttp(streamObjectOrId, data, requestOptions = {}, k // Send data to the stream return authFetch( - `${this.options.restUrl}/streams/${encodeURIComponent(streamId)}/data`, + getEndpointUrl(this.options.restUrl, 'streams', streamId, 'data'), this.session, { ...requestOptions,