Skip to content

Commit

Permalink
Don't create an internal link if external links are disallowed
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jul 27, 2023
1 parent 67c7a89 commit 7fe981e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/StacLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default {
}
},
computed: {
...mapState(['privateQueryParameters']),
...mapGetters(['toBrowserPath', 'getRequestUrl']),
...mapState(['allowExternalAccess', 'privateQueryParameters']),
...mapGetters(['toBrowserPath', 'getRequestUrl', 'isExternalUrl']),
icon() {
if (this.stac) {
let icons = this.stac.getIcons();
Expand Down Expand Up @@ -75,6 +75,9 @@ export default {
if (!Utils.isStacMediaType(this.link.type, true)) {
return false;
}
if (!this.allowExternalAccess && this.isExternalUrl(this.link.href)) {
return false;
}
return stacBrowserNavigatesTo.includes(this.link.rel);
},
attributes() {
Expand Down Expand Up @@ -142,4 +145,4 @@ export default {
}
}
};
</script>
</script>

0 comments on commit 7fe981e

Please sign in to comment.