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

Fixing a big with set_entry response continue. #35

Merged
merged 1 commit into from Apr 23, 2014

Conversation

shano
Copy link
Contributor

@shano shano commented Apr 23, 2014

SugarCRMs set_entry function returns a response like so:

HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Date: Wed, 23 Apr 2014 15:02:32 GMT

That Continue response will break AlexSoft's curl function on this line:
list($responseParts['headersString'], $responseParts['body']) = explode("\r\n\r\n", $this->_response, 2);

This will dump everything, including the HTTP/1.1 200 OK and all other server headers into the output body(where only json should be), thereby breaking the json_decode function. I've added a workaround to fix this by sending an empty expect to circumvent the 100.

…d by an actual 200. That was causing the curl lib to incorrectly dump server headers into the json response and break the json_decode call. I've added a workaround to fix this.
asakusuma added a commit that referenced this pull request Apr 23, 2014
Fixing a big with set_entry response continue.
@asakusuma asakusuma merged commit bee6647 into asakusuma:master Apr 23, 2014
@asakusuma
Copy link
Owner

Thanks!

@shano
Copy link
Contributor Author

shano commented Apr 24, 2014

No worries!

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

Successfully merging this pull request may close these issues.

None yet

2 participants