Skip to content

Conversation

thanhedman
Copy link
Contributor

@thanhedman thanhedman commented Jun 19, 2020

Requests for null entity operations (like resumeSubscription) are now rejected by the Recurly v2 API with status code 411. This is because content-length header is not set in the case where there is no entity.

This PR sets the content-length header to 0 when the entity is null.

@thanhedman
Copy link
Contributor Author

Sample error:
Got Recurly API Exception RecurlyAPIError{description='null', symbol='null', details='null', httpStatusCode='411', responseMetadata='ResponseMetadata{requestId=null, cfRay=5a5aa65fa92ce0d6-IAD, statusCode=411}'}, Description: null

@joannasese joannasese self-assigned this Jun 19, 2020
@joannasese
Copy link
Contributor

@thanhedman Thanks for reporting. We're looking into this and will respond soon.

@joannasese
Copy link
Contributor

@thanhedman which version of the library are you using?

@thanhedman
Copy link
Contributor Author

@joannasese Discovered in production with 0.27.0, reproduced with 0.34.0.

@thanhedman
Copy link
Contributor Author

If you're a Recurly employee, I believe there is also back-channel communication going on about this, via Jeff Sheldon.

@joannasese
Copy link
Contributor

Hi @thanhedman. After looking into this, we found that the issue with content-length headers is addressed through an Apache upgrade that has yet to be released. We'll get 0.35.0 out shortly and will close out this PR after the release has been cut.

@slisaasquatch
Copy link
Contributor

Hi @thanhedman, I recently switched out the underlying HTTP client of this library from an outdated ning AHC to Apache HC4. I'm pretty sure that Apache HC4 will fix this issue. So basically the version you are having issues with is still using the old HTTP client. So I don't think this pull request is necessary.

@thanhedman
Copy link
Contributor Author

@joannasese @slisaasquatch that all makes sense! I saw the lib changes on master:HEAD vs 0.34.0 and thought they might fix the issue, but also thought that maybe that larger revision had more obstacles to release. I'll close this now!

@thanhedman thanhedman closed this Jun 23, 2020
@bhelx
Copy link
Member

bhelx commented Jun 23, 2020

@slisaasquatch thanks again! that PR is paying dividends.

@thanhedman thanhedman deleted the add-content-length-0 branch June 14, 2021 16:00
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.

4 participants