Explorar o código

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

jomo %!s(int64=9) %!d(string=hai) anos
pai
achega
f088c27012
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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);
     }