Skip to content

Commit

Permalink
Add failing test for missing data of FastBoot's package.json
Browse files Browse the repository at this point in the history
Adds accessing `request.host` to `fastboot-app` that reproduces the missing FastBoot package.json data (here `hostWhitelist`) reported in embroider-build#160.
  • Loading branch information
simonihmig committed Oct 20, 2020
1 parent 296dd52 commit 241c398
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test-packages/fastboot-app/app/routes/index.js
@@ -0,0 +1,14 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class IndexRoute extends Route {
@service
fastboot;

beforeModel() {
// This is only to to make sure we can correctly access the request's host, which fails if FastBoot's `hostWhitelist`
// is not correctly set up. This is the case when the changes added to /dist/package.json by FastBoot are not correctly
// merged by Embroider. So this serves as a reproduction of https://github.com/embroider-build/embroider/issues/160
return this.fastboot.isFastBoot ? this.fastboot.request.host : null;
}
}

0 comments on commit 241c398

Please sign in to comment.