mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Custom-encode forward slashes in URL parameters as Apache HTTPD doesn't allow them in some cases. Fixes #3998
This commit is contained in:
committed by
Dave Page
parent
ecbba79c2a
commit
36ffdb93e8
@@ -36,5 +36,61 @@ function (SqlEditorUtils) {
|
||||
expect(SqlEditorUtils.calcFontSize(2)).toEqual('2em');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Remove the slashes', function () {
|
||||
it('it will remove the slashes', function () {
|
||||
expect(
|
||||
SqlEditorUtils.removeSlashInTheString('/')
|
||||
).toEqual({
|
||||
'slashLocations': '0',
|
||||
'title': '',
|
||||
});
|
||||
});
|
||||
|
||||
it('it will remove if slashes are present', function () {
|
||||
expect(
|
||||
SqlEditorUtils.removeSlashInTheString('my/test')
|
||||
).toEqual({
|
||||
'slashLocations': '2',
|
||||
'title': 'mytest',
|
||||
});
|
||||
});
|
||||
|
||||
it('it will remove all the slashes are present', function () {
|
||||
expect(
|
||||
SqlEditorUtils.removeSlashInTheString('my/test/value')
|
||||
).toEqual({
|
||||
'slashLocations': '2,7',
|
||||
'title': 'mytestvalue',
|
||||
});
|
||||
});
|
||||
|
||||
it('it will remove all the slashes are present', function () {
|
||||
expect(
|
||||
SqlEditorUtils.removeSlashInTheString('a/bb/ccc/dddd/eeeee')
|
||||
).toEqual({
|
||||
'slashLocations': '1,4,8,13',
|
||||
'title': 'abbcccddddeeeee',
|
||||
});
|
||||
});
|
||||
|
||||
it('it will not remove if slash is not present', function () {
|
||||
expect(
|
||||
SqlEditorUtils.removeSlashInTheString('mytest')
|
||||
).toEqual({
|
||||
'slashLocations': '',
|
||||
'title': 'mytest',
|
||||
});
|
||||
});
|
||||
|
||||
it('it will not remove if value is not present', function () {
|
||||
expect(
|
||||
SqlEditorUtils.removeSlashInTheString('')
|
||||
).toEqual({
|
||||
'slashLocations': '',
|
||||
'title': '',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user