Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Jul 29, 2022
1 parent ab26012 commit 09db402
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset-frontend/src/utils/urlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ export function getDashboardPermalink({
const externalUrlRegex =
/^([^:/?#]+:)?(?:(\/\/)?([^/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/;

// group 1 matches protocol
// group 2 matches '//'
// group 3 matches hostname
export function isUrlExternal(url: string) {
const match = url.match(externalUrlRegex) || [];
return (
Expand Down

0 comments on commit 09db402

Please sign in to comment.