-
Notifications
You must be signed in to change notification settings - Fork 6
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
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Request
Request parsed
The text was updated successfully, but these errors were encountered: