-
Notifications
You must be signed in to change notification settings - Fork 777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookies not working – again (regression?) #106
Comments
Update: Testing the same requests with the Docker container provided via microbox/node-url-to-pdf-api displayed a hint to a potential fix:
And in fact, with a # curl -o test.pdf -XPOST -d '{"url": "http://github.com", "cookies": [{ "name": "foo", "value": "bar", "domain": "localhost" }]}' -H "Content-Type: application/json" http://localhost:9000/api/render
2019-05-06T11:11:26.137Z - info: [render-core.js] Rendering with opts: {
"cookies": [
{
"name": "foo",
"value": "bar",
"domain": "github.com"
}
],
"scrollPage": false,
"emulateScreenMedia": true,
"ignoreHttpsErrors": false,
"html": null,
"viewport": {
"width": 1600,
"height": 1200
},
"goto": {
"waitUntil": "networkidle2"
},
"output": "pdf",
"pdf": {
"format": "A4",
"printBackground": true
},
"screenshot": {
"type": "png",
"fullPage": true
},
"failEarly": false,
"url": "http://github.com"
}
2019-05-06T11:11:26.322Z - info: [render-core.js] Set browser viewport..
2019-05-06T11:11:26.323Z - info: [render-core.js] Emulate @media screen..
2019-05-06T11:11:26.324Z - info: [render-core.js] Setting cookies..
2019-05-06T11:11:26.328Z - info: [render-core.js] Goto url http://github.com ..
2019-05-06T11:11:29.746Z - info: [render-core.js] Rendering ..
2019-05-06T11:11:32.614Z - info: [render-core.js] Closing browser..
POST /api/render 200 6544.997 ms - 10299087 So, the fix for one half of this issue (the POST part) is obviously to add to the README that a cookie’s |
I haven't personally used the cookies option so the workings are unknown for me. I'm happy to merge a PR which improves readme. |
If I read #83 correctly, it should have been merged into master already.
However, after I installed this package via git clone / npm install today, I get an error message in the console output when I try to render a page with a cookie:
Furthermore, the cookies do not come through at all when using GET:
Would be grateful for assistance or clarification.
The text was updated successfully, but these errors were encountered: