diff --git a/index.js b/index.js index 49fe816..8647e35 100644 --- a/index.js +++ b/index.js @@ -110,7 +110,7 @@ function got(url, opts, cb) { return; } - if (opts.method === 'POST' || opts.method === 'PUT') { + if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH') { proxy.setWritable(req); return; } diff --git a/test.js b/test.js index 9af8883..d82e4b4 100644 --- a/test.js +++ b/test.js @@ -174,4 +174,14 @@ describe('POST', function () { }) .end('Hello'); }); + + it('should be a writeable stream on PATCH', function (done) { + got.patch('http://0.0.0.0:8081') + .on('error', done) + .on('data', function (chunk) { + assert.equal(chunk, 'Hello'); + done(); + }) + .end('Hello'); + }); });