Skip to content

Commit

Permalink
[7.x] [Maps] Explicitly pass fetch function to ems-client (#61… (#61979)
Browse files Browse the repository at this point in the history
* Add fetchFunction binding appropriate version of fetch for ems client

* Wrap standard window fetch prior to passing to ems-client

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
Aaron Caldwell and elasticmachine authored Apr 1, 2020
1 parent 63712a7 commit 620f304
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/legacy/ui/public/vis/map/service_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ uiModules
tileApiUrl: mapConfig.emsTileApiUrl,
htmlSanitizer: $sanitize,
landingPageUrl: mapConfig.emsLandingPageUrl,
// Wrap to avoid errors passing window fetch
fetchFunction: function(...args) {
return fetch(...args);
},
});
}

Expand Down
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/maps/server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function initRoutes(server, licenseUid) {
fileApiUrl: mapConfig.emsFileApiUrl,
tileApiUrl: mapConfig.emsTileApiUrl,
landingPageUrl: mapConfig.emsLandingPageUrl,
fetchFunction: fetch,
});
emsClient.addQueryParams({ license: licenseUid });
} else {
Expand Down

0 comments on commit 620f304

Please sign in to comment.