This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Fails parsing request #4
Comments
OK, this will work: parseResponse = function(responseString) {
var headerLines, line, lines, parsedStatusLine, response;
response = {};
lines = responseString.replace(/\r/, '').split('\n'); // <- fix
parsedStatusLine = parseStatusLine(lines.shift());
response['protocolVersion'] = parsedStatusLine['protocol'];
response['statusCode'] = parsedStatusLine['statusCode'];
response['statusMessage'] = parsedStatusLine['statusMessage'];
headerLines = [];
while (lines.length > 0) {
line = lines.shift();
if (line === "") {
break;
}
headerLines.push(line);
}
response['headers'] = parseHeaders(headerLines);
response['body'] = lines.join('\r\n');
return response;
}; |
Hi @SunboX, It's cool you're using this little library! Do I assume correctly that this snippet fixes this issue? Can you please file a pull request? Thanks! |
Hi Adam, yes I'm using it together with https://github.com/jasmine/jasmine-ajax |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Request
Request parsed
The text was updated successfully, but these errors were encountered: