diff --git a/src/core_plugins/elasticsearch/lib/create_proxy.js b/src/core_plugins/elasticsearch/lib/create_proxy.js index 2ef2bd1da56d..068712ca9c70 100644 --- a/src/core_plugins/elasticsearch/lib/create_proxy.js +++ b/src/core_plugins/elasticsearch/lib/create_proxy.js @@ -20,7 +20,17 @@ function createProxy(server, method, route, config) { xforward: true, timeout: server.config().get('elasticsearch.requestTimeout'), onResponse: function (err, responseFromUpstream, request, reply) { - reply(err, responseFromUpstream); + if (err) { + reply(err); + return; + } + + if (responseFromUpstream.headers.location) { + // TODO: Workaround for #8705 until hapi has been updated to >= 15.0.0 + responseFromUpstream.headers.location = encodeURI(responseFromUpstream.headers.location); + } + + reply(null, responseFromUpstream); } } }, diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 15bbf4aada83..bd9bfec02480 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -74,6 +74,16 @@ bdd.describe('visualize app', function describeIndexTests() { }); }); + bdd.it('should save and load with non-ascii characters', async function () { + const vizNamewithSpecialChars = `${vizName1} with Umlaut รค`; + const message = await PageObjects.visualize.saveVisualization(vizNamewithSpecialChars); + + PageObjects.common.debug(`Saved viz message with umlaut = ${message}`); + expect(message).to.be(`Visualization Editor: Saved Visualization "${vizNamewithSpecialChars}"`); + + await PageObjects.visualize.waitForToastMessageGone(); + }); + bdd.it('should save and load', function () { return PageObjects.visualize.saveVisualization(vizName1) .then(function (message) {