Skip to content
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

No key value pair found breaks parsing #33

Closed
bfelbo opened this issue Apr 15, 2018 · 3 comments
Closed

No key value pair found breaks parsing #33

bfelbo opened this issue Apr 15, 2018 · 3 comments

Comments

@bfelbo
Copy link

bfelbo commented Apr 15, 2018

Hi,

I'm using cookiejar as part of the popular scraping package x-ray. For some links, cookiejar will break with an error TypeError: Cannot read property '1' of null with the stack trace referring to https://github.com/bmeck/node-cookiejar/blob/master/cookiejar.js#L72. It breaks even when used within a try/except block so I can't do much to prevent this problem in my code. Can you give me some advice on how to fix this issue or help me make cookiejar throw a relevant error that I can catch downstream?

There's a reproducible example here:
matthewmueller/x-ray#234

@danielmcq
Copy link
Contributor

I've ran into this error myself. I was able to avoid it by ensuring that the cookies I was putting into cookiejar didn't have any empty strings or incomplete values. However, I think we can probably get some tweaks made to the code to avoid this situation.

@danielmcq
Copy link
Contributor

I have a PR which fixes this issue. I tested it against the example given on matthewmueller/x-ray#234.

@bfelbo
Copy link
Author

bfelbo commented Apr 18, 2018

Great, thanks a lot!

@bfelbo bfelbo closed this as completed Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants