Custom-encode forward slashes in URL parameters as Apache HTTPD doesn't allow them in some cases. Fixes #3998

This commit is contained in:
Murtuza Zabuawala
2019-03-01 14:55:25 +00:00
committed by Dave Page
parent ecbba79c2a
commit 36ffdb93e8
6 changed files with 93 additions and 17 deletions

View File

@@ -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': '',
});
});
});
});
});