Skip to content

Commit

Permalink
Merge pull request #610 from doug-wade/fix-228
Browse files Browse the repository at this point in the history
Implement toJson on ReactServerAgent request for logging/debugging
  • Loading branch information
doug-wade authored Aug 26, 2016
2 parents 0b64f43 + 320d90e commit f9b841e
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,
cacheWhitelist: this._cacheWhitelist,
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 f9b841e

Please sign in to comment.