This repository was archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
HTTP Parser - fatal - parse request string #1574
Labels
Comments
It works with v0.4.11 and v0.5.4 (Ubuntu).
What version of node are you running? |
i;m running the same version 0.4.11 but in context of server.create... I will post better example in minutes |
in context of server.create it doesnt work: check this, please: |
Because http-parser is still processing a current request. var server = http.createServer(function(request, response){
process.nextTick(function() {
var str = "GET /test HTTP/1.1\r\n" +
"User-Agent: curl/7.18.0 (i486-pc-linux-gnu)\r\n" +
"Host: 0.0.0.0=5000\r\n" +
"Accept: */*\r\n" +
"\r\n";
var buffer = new Buffer(str);
var parser = http.parsers.alloc();
parser.reinitialize('request');
parser.onIncoming = function(res){
console.log(res.headers);
};
parser.execute(buffer, 0, buffer.length);
parser.finish(); // don't forget
});
}); |
thank you this is what i wanted! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have request message in a string.
I want to convert it to request Object (to easly retreive headers and so on)
Snippet:
Node is failing on assertion:
assertion "!current_buffer" failed: file "../src/node_http_parser.cc", line 263, function: static v8::Handlev8::Value node:
:Parser::Execute(const v8::Arguments&)
Aborted (core dumped)
How I can do this? I want to parse http request string.
The text was updated successfully, but these errors were encountered: