Skip to content

Commit

Permalink
Merge pull request #150 from st-h/fastboot-url
Browse files Browse the repository at this point in the history
fastboot-adapter fails when different domains are used: remove domain and protocol from shoebox key
  • Loading branch information
ryanto authored Aug 6, 2019
2 parents d290ef0 + 2dca576 commit 6bed766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/mixins/fastboot-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default Mixin.create({

return function(response) {
if (isFastboot) {
let key = shoeboxize(cacheKey([type, url, params]));
let key = shoeboxize(cacheKey([type, url.replace(/^.*\/\/[^\/]+/, ''), params]));
cache[key] = JSON.stringify(response);
}

Expand All @@ -60,7 +60,7 @@ export default Mixin.create({
let box = shoebox && shoebox.retrieve('ember-data-storefront');

if (!isFastboot && box && box.queries && Object.keys(box.queries).length > 0) {
let key = shoeboxize(cacheKey([type, url, params]));
let key = shoeboxize(cacheKey([type, url.replace(/^.*\/\/[^\/]+/, ''), params]));
payload = box.queries[key];
delete box.queries[key];
}
Expand Down

0 comments on commit 6bed766

Please sign in to comment.