Skip to content

Commit 271bb8c

Browse files
iparamonaunleush
authored andcommitted
Domains: fix Google Maps consent redirect for servers in the EU
1 parent 0cf3cc7 commit 271bb8c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config.local.js.SAMPLE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ export default {
237237
},
238238
google: {
239239
// https://developers.google.com/maps/documentation/embed/guide#api_key
240-
maps_key: "INSERT YOUR VALUE"
240+
maps_key: "INSERT YOUR VALUE",
241+
// If your servers are in EU, google maps will redirect to /consent/ page and the plugins won't work. The option below ignores the redirect.
242+
// follow_http_redirect: true
241243
},
242244

243245
/*

plugins/domains/google.com/google.maps.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ export default {
149149
// responseStatusCode: 415, // No error, fall back to generic parsers instead
150150
message: "Google requires your own key for Maps Embeds API. <a href='https://developers.google.com/maps/documentation/embed/get-api-key' target='_blank'>Get one</a> and add it to the provider options."
151151
});
152+
} else if (options.getProviderOptions('google.follow_http_redirect', false)) {
153+
options.followHTTPRedirect = true;
152154
}
153155

154156
var gmap = {};

0 commit comments

Comments
 (0)