Skip to content

Commit cd84a85

Browse files
committedAug 5, 2021
revert
1 parent 5663452 commit cd84a85

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed
 

‎bin/http-server

-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var colors = require('colors/safe'),
1111
argv = require('optimist')
1212
.boolean('cors')
1313
.boolean('log-ip')
14-
.boolean('server-header')
1514
.argv,
1615
pjson = require('../package.json');
1716

@@ -57,7 +56,6 @@ if (argv.h || argv.help) {
5756
'',
5857
' -r --robots Respond to /robots.txt [User-agent: *\\nDisallow: /]',
5958
' --no-dotfiles Do not show dotfiles',
60-
' --no-server-header Hide the "server" header which identifies ecstatic',
6159
' -h --help Print this list and exit.',
6260
' -v --version Print the version and exit.'
6361
].join('\n'));
@@ -134,7 +132,6 @@ function listen(port) {
134132
logFn: logger.request,
135133
proxy: proxy,
136134
showDotfiles: argv.dotfiles,
137-
serverHeader: argv['server-header'],
138135
username: argv.username || process.env.NODE_HTTP_SERVER_USERNAME,
139136
password: argv.password || process.env.NODE_HTTP_SERVER_PASSWORD
140137
};

‎lib/http-server.js

-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ function HttpServer(options) {
8080
this.showDir = options.showDir !== 'false';
8181
this.autoIndex = options.autoIndex !== 'false';
8282
this.showDotfiles = options.showDotfiles;
83-
this.serverHeader = options.serverHeader;
8483
this.gzip = options.gzip === true;
8584
this.brotli = options.brotli === true;
8685
this.contentType = options.contentType || 'application/octet-stream';
@@ -154,7 +153,6 @@ function HttpServer(options) {
154153
cache: this.cache,
155154
showDir: this.showDir,
156155
showDotfiles: this.showDotfiles,
157-
serverHeader: this.serverHeader,
158156
autoIndex: this.autoIndex,
159157
defaultExt: this.ext,
160158
gzip: this.gzip,

‎test/http-server-test.js

-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ vows.describe('http-server').addBatch({
1616
var server = httpServer.createServer({
1717
root: root,
1818
robots: true,
19-
serverHeader: false,
2019
headers: {
2120
'Access-Control-Allow-Origin': '*',
2221
'Access-Control-Allow-Credentials': 'true'
@@ -80,14 +79,6 @@ vows.describe('http-server').addBatch({
8079
assert.equal(res.headers['access-control-allow-credentials'], 'true');
8180
}
8281
},
83-
'and serverHeaderis disabled': {
84-
topic: function () {
85-
request('http://127.0.0.1:8080/', this.callback);
86-
},
87-
'should not respond with headers from ecstatic': function (res) {
88-
assert.isFalse('server' in res.headers);
89-
}
90-
},
9182
'and the server is set to proxy port 8081 to 8080, ': {
9283
topic: function () {
9384
var proxyServer = httpServer.createServer({

0 commit comments

Comments
 (0)
Please sign in to comment.