Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

always use options.headers to set Server header #52

Closed
wants to merge 1 commit into from

2 participants

@pbouzakis

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.

@pbouzakis pbouzakis 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.
09cb9b4
@phstc phstc closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 6, 2012
  1. @pbouzakis

    always use options.headers to set Server header

    pbouzakis authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/node-static.js
View
2  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) {
Something went wrong with that request. Please try again.