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

98
Visualizações
Clicking on link doesnt take me to href link inside the anchor tag

I have created a MERN stack project that takes links of the books and when you click on the name of the book, you can download the books. But my href links doesn't take me to right link even though my link inside the tag is right when I inspect it in the developer tools. My app is working well in localhost. But when I deploy it on Heroku, I face this issue. Here is my take that redirects me to the wrong address.

<a href="https://downloader.disk.yandex.ru/disk/80cbc9fad2fdcc069ca7b58e862b3181f46aeff20e9049ff9f3dbd93806051b1/6163214b/G5C0TX8CiPWFWwuAp3xzTufPyksiVML-SpOQbOukZFCoTLy-nqnTLWx0QHJJrpzusZJDu--tT6ghjzdgmnnIhg%3D%3D?uid=0&amp;filename=Ahmet%20Alpan%20-%20Dost%20Bombalar.epub&amp;disposition=attachment&amp;hash=I9yUHj%2BS67IaRxOANlGbhkKhx%2BMb83KCZa7A9q6PB7NuJBmsS3ntyZUZhtgmzgqmq/J6bpmRyOJonT3VoXnDag%3D%3D%3A/Meritokrasi/T%C3%BCrk%C3%A7e%20%5BePub%5D/Derecelendirilmi%C5%9F%20Kitaplar/Ahmet%20Alpan%20-%20Dost%20Bombalar.epub&amp;limit=0&amp;content_type=application%2Fx-bittorrent&amp;owner_uid=1327282368&amp;fsize=163051&amp;hid=15e448431fdbeff8567e22e9ecb6b8c6&amp;media_type=book&amp;tknv=v2">Ahmet Alpan - Dost Bombalar.epub</a>

I don't know if Yandex or google restrict me for security reasons. Here the app that I deployed in heroku. my-app

I want to share my code that shows how I fetch these download links. I also added encodeURI but it did not work.

    fetch(`/books/${search}`)
      .then((res) => res.json())
      .then((d) => {
        Promise.all(
          d.map((e) => {
            return fetch(
              encodeURI(
                `https://cloud-api.yandex.net:443/v1/disk/public/resources/download?public_key=https://disk.yandex.ru/d/o9lNK0tpVCH7sQ&path=${e.path}`
              )
            )
              .then((res) => res.json())
              .then((res) => {
                return {
                  name: e.name,
                  size: bytes2Size(e.size),
                  date: new Date(e.date).toLocaleDateString(),
                  file: res.href,
                };
              });
          })
        ).then((data) => {
          setBooks(data);
          setIsLoaded(true);
          setisLoading(false);
        });
      });

When I right-click on a book after search, then copy the link address, it is working. But when clicking it is not working.

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