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

138
Vistas
How to use login and password from url to get request

I open my site with the address "http://login:password@localhost:3000/" How can I put an authorization data from url to get the requests? Like this:

Request URL: http://root:root@localhost:3000/vendor.chunk.js
Request Method: GET
Status Code: 304 Not Modified
Remote Address: 127.0.0.1:3000
Referrer Policy: strict-origin-when-cross-origin 

How can I get username and password from url with a Javascript? It is necessary for setting the authorization header for get request.

Thank you very much!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use the split function to achieve that, but it is highly unsafe to put your password into a URL. Whoever sees the URL, including the ISP can easily hack it.

var url = "http://login:password@localhost:3000/"
let parts = url.split("//")[1].split("@")[0].split(":");
let username = parts[0];
let password = parts[1];
console.log(username, password);

about 4 years ago · Juan Pablo Isaza Denunciar
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