Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

355
Views
Vue sanitize a href url

So guys I have an issue like Make sure bypassing Vue built-in sanitization is safe here. with a href URL in vue js, which the URL i get from my API, and then I've tried to sanitize using @braintree/sanitize-url and then put it inside my Vue.prototype.$sanitize like this

import { sanitizeUrl } from "@braintree/sanitize-url"

Vue.prototype.$sanitize = sanitizeUrl

and then i used it on my component like this

data: () => ({
  sanitizeUrl: null
}),
created() {
  // BEFORE SANITIZE : "https://codepen.io/"
  // AFTER SANITIZED : "https://codepen.io/"

  this.sanitizeUrl = this.$sanitize(this.obj.info.url)
}
<a
  :href="sanitizeUrl"
  target="_blank"
  rel="noreferrer noopener nofollow"
/>

everything's good but the sonar cloud still detects this URL is not sanitized yet like Make sure bypassing Vue built-in sanitization is safe here.

how can I sanitize this URL from my API? Thank you guys

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!