Przeglądaj źródła

use '201 Created' when 'status' is 'downloaded'

jomo 9 lat temu
rodzic
commit
f088c27012
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      lib/response.js

+ 1 - 1
lib/response.js

@@ -91,7 +91,7 @@ module.exports = function(request, response, result) {
   } else {
     if (result.body) {
       headers.Etag = etag;
-      response.writeHead(200, headers);
+      response.writeHead(result.status === 2 ? 201 : 200, headers);
     } else {
       response.writeHead(404, headers);
     }