From 09cb9b4a5f7dc13787cc31c66730e177beffb121 Mon Sep 17 00:00:00 2001 From: pbouzakis Date: Fri, 6 Apr 2012 14:11:07 -0400 Subject: [PATCH] always use options.headers to set Server header inside finish, instead of setting Server header to the serverInfo variable, set it to the options.header.Server value, which is set in the constructor function and defaults to the serverInfo variable. on 404 errors, the server would always report node static as the server even if the client code passed in a different Server header in the options param. --- lib/node-static.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node-static.js b/lib/node-static.js index 9399257..8fabae1 100644 --- a/lib/node-static.js +++ b/lib/node-static.js @@ -96,7 +96,7 @@ this.Server.prototype.finish = function (status, headers, req, res, promise, cal message: http.STATUS_CODES[status] }; - headers['Server'] = serverInfo; + headers['Server'] = this.options.headers['Server']; if (!status || status >= 400) { if (callback) {