From b969ecf223d52ec2ea21118a232a88b5ec745992 Mon Sep 17 00:00:00 2001 From: Yazhong Liu Date: Sat, 3 May 2014 02:56:08 +0800 Subject: [PATCH] request: complete idempotent methods see rfc2616: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1. Intact idempotent HTTP methods should be: GET, HEAD, PUT, DELETE, OPTIONS and TRACE --- lib/request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/request.js b/lib/request.js index 34ec754..7c27901 100644 --- a/lib/request.js +++ b/lib/request.js @@ -259,8 +259,8 @@ module.exports = { */ get idempotent() { - return 'GET' == this.method - || 'HEAD' == this.method; + var idempotents = ['GET','HEAD','PUT','DELETE','OPTIONS','TRACE']; + return idempotents.indexOf(this.method) !== -1; }, /**