Skip to content

Commit

Permalink
Fix Incomplete URL substring sanitization (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
felder101 authored Dec 3, 2024
1 parent e497691 commit e931116
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions training-front-end/src/plugins/uswds_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ export function processLinksPlugin() {
// these will all be local, so ignore
return
}

if (!(domain.hostname === 'gsa.gov' || domain.hostname === 'www.gsa.gov'|| domain.protocol === 'mailto:')) {
const internalHost = [
'gsa.gov',
'www.gsa.gov'
]
if (!(internalHost.includes(domain.hostname) || domain.protocol === 'mailto:')) {
properties.className += ' usa-link--external'
}

Expand Down

0 comments on commit e931116

Please sign in to comment.