Skip to content

Commit e1a3cb0

Browse files
committed
fix(urlParams): don't split URLs containing commas in query strings
1 parent 55a57e3 commit e1a3cb0

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

src/utils/urlParams.test.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ describe('normalizeUrlParams', () => {
2929
]);
3030
});
3131

32-
it('handles comma-separated URLs', () => {
33-
const result = normalizeUrlParams({
34-
urls: 'https://example.com/file1.dcm,https://example.com/file2.dcm',
35-
});
36-
expect(result.urls).toEqual([
37-
'https://example.com/file1.dcm',
38-
'https://example.com/file2.dcm',
39-
]);
40-
});
41-
4232
it('allows relative URLs (they resolve against base URL)', () => {
4333
const result = normalizeUrlParams({
4434
urls: ['https://example.com/valid.dcm', 'relative-path', 'another/path'],
@@ -59,6 +49,13 @@ describe('normalizeUrlParams', () => {
5949
]);
6050
});
6151

52+
it('preserves commas in query strings', () => {
53+
const result = normalizeUrlParams({
54+
urls: '/api/v1/folder/123/volview?items=id1,id2,id3',
55+
});
56+
expect(result.urls).toEqual(['/api/v1/folder/123/volview?items=id1,id2,id3']);
57+
});
58+
6259
it('handles config and names parameters', () => {
6360
const result = normalizeUrlParams({
6461
config: 'https://example.com/config.json',

src/utils/urlParams.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ const parseUrlArray = (value: string | string[]): string[] => {
3535
return splitAndClean(trimmed.slice(1, -1));
3636
}
3737

38-
if (trimmed.includes(',')) {
39-
return splitAndClean(trimmed);
40-
}
41-
4238
return [trimmed];
4339
};
4440

0 commit comments

Comments
 (0)