Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

356
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda