Skip to content

Commit

Permalink
Fix #228: Implement toJson on ReactServerAgent request for logging/de…
Browse files Browse the repository at this point in the history
…bugging
  • Loading branch information
doug-wade committed Aug 23, 2016
1 parent 4d5bc3d commit 9f3c1d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/react-server/core/ReactServerAgent/Request.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ Request.prototype.type = function (type) {
return this;
}

Request.prototype.toJSON = function(){
return {
aborted: this.aborted,
agent: this._agent,
headers: this._headers,
method: this._method,
postParams: this._postParams,
queryParams: this._queryParams,
timeout: this._timeout,
type: this._type,
urlPath: this._urlPath,
};
}

/**
* Wrap superagent's end() method to create an entry in a request-local
* data cache that will be serialized to the client and replayed in the
Expand Down

0 comments on commit 9f3c1d4

Please sign in to comment.