forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows for more than 2 level path be shared
Signed-off-by: Ashwin P Chandran <[email protected]>
- Loading branch information
Showing
2 changed files
with
5 additions
and
5 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 |
---|---|---|
|
@@ -43,11 +43,8 @@ describe('shortUrlAssertValid()', () => { | |
['hostname', 'localhost/app/opensearch-dashboards', PATH_ERROR], // according to spec, this is not a valid URL -- you cannot specify a hostname without a protocol | ||
['hostname and port', 'local.host:5601/app/opensearch-dashboards', PROTOCOL_ERROR], // parser detects 'local.host' as the protocol | ||
['hostname and auth', 'user:[email protected]/app/opensearch-dashboards', PROTOCOL_ERROR], // parser detects 'user' as the protocol | ||
['path traversal', '/app/../../not-opensearch-dashboards', PATH_ERROR], // fails because there are >2 path parts | ||
['path traversal', '/../not-opensearch-dashboards', PATH_ERROR], // fails because first path part is not 'app' | ||
['deep path', '/app/opensearch-dashboards/foo', PATH_ERROR], // fails because there are >2 path parts | ||
['deeper path', '/app/opensearch-dashboards/foo/bar', PATH_ERROR], // fails because there are >2 path parts | ||
['base path', '/base/app/opensearch-dashboards', PATH_ERROR], // fails because there are >2 path parts | ||
['base path', '/base/app/opensearch-dashboards', PATH_ERROR], // fails because first path part is not 'app' | ||
['path with an extra leading slash', '//foo/app/opensearch-dashboards', HOSTNAME_ERROR], // parser detects 'foo' as the hostname | ||
['path with an extra leading slash', '///app/opensearch-dashboards', HOSTNAME_ERROR], // parser detects '' as the hostname | ||
['path without app', '/foo/opensearch-dashboards', PATH_ERROR], // fails because first path part is not 'app' | ||
|
@@ -63,10 +60,13 @@ describe('shortUrlAssertValid()', () => { | |
const valid = [ | ||
'/app/opensearch-dashboards', | ||
'/app/opensearch-dashboards/', // leading and trailing slashes are trimmed | ||
'/app/opensearch-dashboards/deeper', | ||
'/app/monitoring#angular/route', | ||
'/app/text#document-id', | ||
'/app/text/deeper#document-id', | ||
'/app/some?with=query', | ||
'/app/some?with=query#and-a-hash', | ||
'/app/some/deeper?with=query#and-a-hash', | ||
]; | ||
|
||
valid.forEach((url) => { | ||
|
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