Skip to content

Commit

Permalink
[Maps] Explicitly pass fetch function to ems-client (elastic#61846)
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 <[email protected]>
  • Loading branch information
Aaron Caldwell and elasticmachine committed Mar 31, 2020
1 parent c7b9e05 commit 2012df3
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 2012df3

Please sign in to comment.