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

203
Visualizações
How to get client full url in AWS lambda through AWS gateway requested by <script src="***"> tag

I am using html script tag to ping AWS gateway endpoint to trigger a function in AWS lambda.

In this lambda function, I need to retrieve the original client's full url. I can get referer data but can't figure out how to get the full url.

I tried to see if there is "origin" info in "event" object but there is no such data.

exports.handler = async (event, context) => {
  return {
    statusCode: 200,
    body: "console.log(" +JSON.stringify(event) +","+JSON.stringify(context) +")"
  };  
}

Here is the client code that pings the http api gateway index.html

<html>
  <script src="http api gateway endpoint" defer async />
  <body></body>
</html>

Now how can I get the client full url in lambda function?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The information sent in a referrer header is restricted for security reasons. You can adjust this with a header or the referrerpolicy attribute.

Note that the <script> element is not a void element. The end tag is mandatory.

<script src="http api gateway endpoint" defer async referrerpolicy"unsafe-url"></script>

You could also generate the <script> element dynamically and pass data from window.location in the query string.

about 4 years ago · Santiago Trujillo Relatório
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