sambaiz / puppeteer-lambda-starter-kit

Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
MIT License
580 stars 82 forks source link

Cant handle multiple redirects #1

Closed camberlucian closed 6 years ago

camberlucian commented 6 years ago

Kind of a weird one but when have a page goto a url that uses multiple redirects I will get a 200 OK response instead of the 302 redirect that i need. The strange thing is that it works fine when ran locally but on lambda it stops and ends with the 200 after the first redirect.

Too clarify:

When I run it locally it does what it should so which is this Request:GET -> Response:302 -> Request:GET -> Response:302 -> Request:GET -> Response:302 -> Request:GET -> Response:302 -> Request:GET -> Response:200 OK (the page it should be on)

When I run it on a lambda It does this Request:GET -> Response:302 -> Request:GET -> Response:200 OK (blank html page)

Is there a limit to redirects in the chrome binary? I have tried the binary provided as well as the one that is build using the build.sh script that is provided.

The code I am using is just a simple page.goto(url)

Any help would be vastly appreciated

camberlucian commented 6 years ago

fixed the problem. turned out to be the place i was navigating to was blocking the IP i was using.