1

I understand that we can set mapping template for API Gateway with Lambda integration request. With this type of request integration, referrer url can be fetched as explained in this answer But for Proxy Lambda integration, we do not have option to set mapping template.

Is there a way to get referrer url even if I have enabled Lambda Proxy integration? Can we still use initial request object inside Lambda function?

sheenu85
  • 168
  • 2
  • 11
  • `proxy integration` *proxies* the request / response through and the API gateway do not do any *transformations* as with `lambda integration`... you'd have to take the request properties from your lambda handler... – kukkuz Jul 25 '18 at 12:25
  • Did you look in `event.headers['referer']` inside the Lambda function? – Michael - sqlbot Jul 28 '18 at 00:39
  • @Michael-sqlbot, event.headers['referer'] is not available with proxy setting. – sheenu85 Jul 31 '18 at 04:44
  • `console.log("request: " + JSON.stringify(event));` It *should* be there: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format – Michael - sqlbot Jul 31 '18 at 13:19

0 Answers0