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

198
Views
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 answers
Answer question

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 Report
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!