Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

357
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda