-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
/* globals define FastBoot */ | ||
import setupFetch from 'fetch/setup'; | ||
|
||
/** | ||
* To allow relative URLs for Fastboot mode, we need the per request information | ||
* from the fastboot service. Then we re-define the `fetch` amd module. | ||
*/ | ||
function patchFetchForRelativeURLs(instance) { | ||
const fastboot = instance.lookup('service:fastboot'); | ||
const request = fastboot.get('request'); | ||
// host is cp | ||
setupFetch(request.protocol, request.get('host'))(); | ||
} | ||
|
||
export default { | ||
name: 'fetch', | ||
initialize: function patchFetchForRelativeURLs(instance) { | ||
const fastboot = instance.lookup('service:fastboot'); | ||
const request = fastboot.get('request'); | ||
// host is cp | ||
setupFetch(request.protocol, request.get('host'))(); | ||
} | ||
initialize: patchFetchForRelativeURLs | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters