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

161
Visualizações
How to determine with javascript whether a url that ends with no extensions is a plain image and not a gif?

I am trying to validate URLs and return false if such URLs happen to return gifs, like these:

  • https://lh3.googleusercontent.com/nxOF05Y28F2WSBPupmOBgTuSxG-GY1BbhZJyOrjVrjKdAax0VTb4_q4_yDnNsFMTdXPZYpmr19nttJ8c1Pzzd835vOEODQGUvcPG
  • https://lh3.googleusercontent.com/s4a9blztSlDXhjApbdob6CfQ6OUeIiRxb00w9-4Z2Q-6PIp9FGePtI8NBfUfgSgAki3EI2too6zdRyV9qwxdnUWaYLWGgkBa0MN_
  • https://lh3.googleusercontent.com/TJIJhjYUMN2iHsS7Su_WnnfqfbQmJI8y8-zU32-GzYfbDDwofXLMRKk_Q2FTzT096dzDIyptA7-khH2tbCWwbvuWf6V4ITCf3ZncuA
  • https://lh3.googleusercontent.com/4rIhhfLWqB3qUi-BMkXlyMnylwztk-HfOUQhtsmPBtfJKLh2FPNPMgL3YL6Jg0JMopsMcjaevYjXYw8lR9vFRfrZ2rsV7JXPo6mRVws

However, I cannot use regex as no URL returns something that ends with ".gif".

I have no idea how to verify the format of a file that is returned from a URL, if the said file does not have an extension at the end... may anyone point me in the right direction?

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