Closed luastoned closed 9 years ago
Thanks for the report. I will investigate it.
The docs also state that res.headers
should be a HTTPHeaders
instance, which does not seem to be true.
Nop, its a HTTPParser instance. It was changed at some point...
Updating http-parser
from 2.1
to 2.5
seems to fix the issue.
Can we have information about the request-headers assuming we get redirected? There is no way to tell what site we landed on following any short-url at the moment.
Doesn't really help to upgrade the version to fix segfault, there is something else at play.
In master you will no longer get a segfault from this. The problem is that the URL is never set in HTTPParser when parsing responses causing a segfault when ffi.string is used on a invalid pointer... Instead we now raise a error saying that the value is not inited for responses. The new .url attribute should be used instead.
To add, you can still use HTTPParser for this, by using parse_url() and get_url_field() of the HTTPParser class.