Skip to content

Commit f21a2fe

Browse files
author
Budleigh Salterton
committed
conform to option style
1 parent 0989c2c commit f21a2fe

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bin/http-server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function listen(port) {
105105
if (argv.cors) {
106106
options.cors = true;
107107
if (typeof argv.cors === 'string') {
108-
options.cors_headers = argv.cors;
108+
options.corsHeaders = argv.cors;
109109
}
110110
}
111111

lib/http-server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ function HttpServer(options) {
6767
if (options.cors) {
6868
this.headers['Access-Control-Allow-Origin'] = '*';
6969
this.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Range';
70-
if (options.cors_headers) {
71-
options.cors_headers.split(/\s*,\s*/)
70+
if (options.corsHeaders) {
71+
options.corsHeaders.split(/\s*,\s*/)
7272
.forEach(function (h) { this.headers['Access-Control-Allow-Headers'] += ', ' + h; }, this);
7373
}
74-
before.push(corser.create(options.cors_headers ? {
74+
before.push(corser.create(options.corsHeaders ? {
7575
requestHeaders: this.headers['Access-Control-Allow-Headers'].split(/\s*,\s*/)
7676
} : null));
7777
}

test/http-server-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ vows.describe('http-server').addBatch({
130130
var server = httpServer.createServer({
131131
root: root,
132132
cors: true,
133-
cors_headers: 'X-Test'
133+
corsHeaders: 'X-Test'
134134
});
135135
server.listen(8082);
136136
this.callback(null, server);

0 commit comments

Comments
 (0)