Skip to content

Commit c939b82

Browse files
committed
Standardized on hostAllowList
1 parent d61b516 commit c939b82

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -273,23 +273,23 @@ module.exports = function(environment) {
273273
},
274274

275275
fastboot: {
276-
hostAllowlist: ['example.com', 'subdomain.example.com', /^localhost:\d+$/]
276+
hostAllowList: ['example.com', 'subdomain.example.com', /^localhost:\d+$/]
277277
}
278278
};
279279
// ...
280280
};
281281
```
282282

283-
The `hostAllowlist` can be a string or RegExp to match multiple hosts.
283+
The `hostAllowList` can be a string or RegExp to match multiple hosts.
284284
Care should be taken when using a RegExp, as the host function relies on
285285
the `Host` HTTP header, which can be forged. You could potentially allow
286286
a malicious request if your RegExp is too permissive when using the `host`
287287
when making subsequent requests.
288288

289289
Retrieving `host` will error on 2 conditions:
290290

291-
1. you do not have a `hostAllowlist` defined
292-
2. the `Host` header does not match an entry in your `hostAllowlist`
291+
1. you do not have a `hostAllowList` defined
292+
2. the `Host` header does not match an entry in your `hostAllowList`
293293

294294
### Query Parameters
295295

packages/ember-cli-fastboot/fastboot/initializers/ajax.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var nodeAjax = function(options) {
1414
try {
1515
options.url = protocol + '//' + get(this, 'fastboot.request.host') + options.url;
1616
} catch (fbError) {
17-
throw new Error('You are using Ember Data with no host defined in your adapter. This will attempt to use the host of the FastBoot request, which is not configured for the current host of this request. Please set the hostAllowlist property for in your environment.js. FastBoot Error: ' + fbError.message);
17+
throw new Error('You are using Ember Data with no host defined in your adapter. This will attempt to use the host of the FastBoot request, which is not configured for the current host of this request. Please set the hostAllowList property for in your environment.js. FastBoot Error: ' + fbError.message);
1818
}
1919
}
2020

packages/ember-cli-fastboot/lib/broccoli/fastboot-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ module.exports = class FastBootConfig extends Plugin {
162162
buildHostAllowList() {
163163
if (this.fastbootAppConfig) {
164164
if ('hostWhitelist' in this.fastbootAppConfig) {
165-
this.ui.writeLine('Please update your fastboot config to use `hostAllowList` of the deprecated `hostWhitelist`');
165+
this.ui.writeLine('Please update your fastboot config to use `hostAllowList` instead of the deprecated `hostWhitelist`');
166166
}
167167
this.hostAllowList = this.fastbootAppConfig.hostAllowList || this.fastbootAppConfig.hostWhitelist
168168
}

packages/ember-cli-fastboot/test/fastboot-config-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ describe('FastbootConfig', function() {
5454
'package.json': `{"dependencies":{},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"hostAllowList":["example.com","subdomain.example.com"],"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleAllowlist":[],"schemaVersion":3}}`
5555
});
5656

57-
expect(output.builder.outputNode.ui.output).to.contain('Please update your fastboot config to use `hostAllowList` of the deprecated `hostWhitelist`');
57+
expect(output.builder.outputNode.ui.output).to.contain('Please update your fastboot config to use `hostAllowList` instead of the deprecated `hostWhitelist`');
5858
});
5959
});

packages/ember-cli-fastboot/test/fixtures/fastboot-config/config/environment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = function(environment) {
1919
},
2020

2121
fastboot: {
22-
hostAllowlist: ['example.com', 'subdomain.example.com', /localhost:\d+/]
22+
hostAllowList: ['example.com', 'subdomain.example.com', /localhost:\d+/]
2323
}
2424
};
2525

packages/ember-cli-fastboot/test/fixtures/fastboot-location-config/config/environment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function(environment) {
88
modulePrefix: 'fastboot-location-config',
99
fastboot: {
1010
fastbootHeaders: false,
11-
hostAllowlist: [/localhost:\d+/],
11+
hostAllowList: [/localhost:\d+/],
1212
redirectCode: 302,
1313
}
1414
};

packages/ember-cli-fastboot/test/fixtures/fastboot-location/config/environment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function(environment) {
88
modulePrefix: 'fastboot-location',
99
fastboot: {
1010
fastbootHeaders: true,
11-
hostAllowlist: [/localhost:\d+/]
11+
hostAllowList: [/localhost:\d+/]
1212
}
1313
};
1414

packages/ember-cli-fastboot/test/fixtures/request/config/environment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = function(environment) {
1919
},
2020

2121
fastboot: {
22-
hostAllowlist: ['example.com', 'subdomain.example.com', /localhost:\d+/]
22+
hostAllowList: ['example.com', 'subdomain.example.com', /localhost:\d+/]
2323
}
2424
};
2525

test-packages/basic-app/test/package-json-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe("generating package.json", function () {
7676
it("contains a list of allowed hosts from environment.js", function () {
7777
let pkg = fs.readJSONSync("dist/package.json");
7878

79-
expect(pkg.fastboot.hostAllowlist).to.deep.equal([
79+
expect(pkg.fastboot.hostAllowList).to.deep.equal([
8080
"example.com",
8181
"subdomain.example.com",
8282
"/localhost:\\d+/",
@@ -117,7 +117,7 @@ describe("generating package.json", function () {
117117
autoboot: false,
118118
},
119119
fastboot: {
120-
hostAllowlist: [
120+
hostAllowList: [
121121
"example.com",
122122
"subdomain.example.com",
123123
"/localhost:\\d+/",

0 commit comments

Comments
 (0)