fix: use full encoded topic iri in streaming http receiveFrom url template

This commit is contained in:
elf Pavlik
2024-08-11 16:28:03 -06:00
parent 4599bf413e
commit 5398c445a6
6 changed files with 21 additions and 10 deletions

View File

@@ -31,6 +31,7 @@ jest.mock('../../../../../src/logging/LogUtil', (): any => {
describe('A StreamingHttpRequestHandler', (): void => {
const logger: jest.Mocked<Logger> = getLoggerFor('mock') as any;
const topic: ResourceIdentifier = { path: 'http://example.com/foo' };
const baseUrl = 'http://example.com/';
const pathPrefix = '.notifications/StreamingHTTPChannel2023/';
const channel: NotificationChannel = {
id: 'id',
@@ -64,7 +65,7 @@ describe('A StreamingHttpRequestHandler', (): void => {
beforeEach(async(): Promise<void> => {
operation = {
method: 'GET',
target: { path: 'http://example.com/.notifications/StreamingHTTPChannel2023/foo' },
target: { path: `http://example.com/.notifications/StreamingHTTPChannel2023/${encodeURIComponent(topic.path)}` },
body: new BasicRepresentation(),
preferences: {},
};
@@ -95,6 +96,7 @@ describe('A StreamingHttpRequestHandler', (): void => {
handler = new StreamingHttpRequestHandler(
streamMap,
baseUrl,
pathPrefix,
generator,
serializer,
@@ -151,6 +153,7 @@ describe('A StreamingHttpRequestHandler', (): void => {
} as any;
handler = new StreamingHttpRequestHandler(
streamMap,
baseUrl,
pathPrefix,
generator,
serializer,