diff --git a/Libraries/Fetch/fetch.js b/Libraries/Fetch/fetch.js index 68c98a90ddb221..ff5ef29bb7c573 100644 --- a/Libraries/Fetch/fetch.js +++ b/Libraries/Fetch/fetch.js @@ -278,6 +278,10 @@ var self = {}; } this._initBody(body) } + + Request.prototype.clone = function() { + return new Request(this) + } function decode(body) { var form = new FormData() @@ -320,6 +324,15 @@ var self = {}; this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers) this.url = options.url || '' } + + Response.prototype.clone = function() { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }) + } Body.call(Response.prototype)