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

184
Views
Encabezado de autorización de solicitud de origen de etiqueta de imagen HTML en Vue.js 3

Entonces, básicamente estoy tratando de interceptar la solicitud de HTML-Image-Tag, para poder agregar mi encabezado de autorización. Estoy tratando de hacer esto con Vue.js 3. Ya intenté usar un ServiceWorker para hacerlo, pero esto no funcionó como se esperaba. Las URL llamadas desde la fuente HTML-Image-Tag se redirigirán a una imagen en la nube. Puedo interceptar la solicitud, pero no puedo redirigir a la URL de destino. También sigo recibiendo errores de autorización.

Aquí está mi código:

 // imageInterceptor.js (in root folder) self.addEventListener('fetch', (event) => { console.log(event) const newRequest = new Request(event.request, { headers: { Authorization: 'Bearer __My-Token__', }, }) return fetch(newRequest) }) // Registration in main.ts await navigator.serviceWorker.register('/imageInterceptor.js')
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!