-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
In .send(obj), obj's toJSON method is not called #1464
In .send(obj), obj's toJSON method is not called #1464
Comments
PR welcome |
Yeah I tried to get it working, but it was quite in the weeds. When I finally figured out where it was should be called and added the code it caused an error. I'll post the error here if I ever get back around to checking it out again. |
@hasahmed I will release fix, one sec |
@hasahmed please try v5.0.9 released to npm, |
Note: this change caused an unintentional library behavior change due to the new upstream dependency. Objects passed to I have an open issue upstream related to this: davidmarkclements/fast-safe-stringify#46 |
I have an object that has a circular property. Because of that I need a
toJSON
method that handles that particular field appropriately. Super agentssend
method doesn't call my objectstoJSON
method and therefore the call toJSON.strigify
inside of superagent its self throws an error.I attempted to fix this myself by calling
data.toJSON
inside ofrequest-base.js:570
when the properties are copied into the requests data, but this lead to the server responding withRejected
later down the line.Here are the lines that I attempted to add
The text was updated successfully, but these errors were encountered: