-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removing encodeURIComponent to avoid double decoding URL * locking all versions so they dont auto fetch latest minor versions * revert package file fix * fixed timeline dependency to use latest version. Current version is depricated. see issue #192 * fixing failing integration test * only escape forward slash * adding console logs to help debugging * moving logic into helper and fixing at router level. * adding unit tests * removing escaped runId as this is generated from server and is gauranteed to be a UUID
- Loading branch information
1 parent
a933099
commit 31f8c8a
Showing
5 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const getEscapedForwardSlash = (str) => str.replace(/\//g, '%2F'); | ||
export default getEscapedForwardSlash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import getEscapedForwardSlash from './get-escaped-forward-slash'; | ||
|
||
describe('getEscapedForwardSlash', () => { | ||
it('should escape one forward slash and convert to %2F.', () => { | ||
const input = '/'; | ||
const output = getEscapedForwardSlash(input); | ||
expect(output).toEqual('%2F'); | ||
}); | ||
|
||
it('should escape many forward slashes and convert each to %2F.', () => { | ||
const input = '///'; | ||
const output = getEscapedForwardSlash(input); | ||
expect(output).toEqual('%2F%2F%2F'); | ||
}); | ||
|
||
it('should convert forward slashes in a string containing other characters with forward slashes.', () => { | ||
const input = 'hello/world'; | ||
const output = getEscapedForwardSlash(input); | ||
expect(output).toEqual('hello%2Fworld'); | ||
}); | ||
|
||
it('should not do anything if string does not contain forward slash.', () => { | ||
const input = 'hello\world'; | ||
const output = getEscapedForwardSlash(input); | ||
expect(output).toEqual('hello\world'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters