Merge pull request #8762 from elastic/jasper/backport/8758/5.0

[backport] PR #8758 to 5.0 - Internal server error when saving a widget with German characters in name
This commit is contained in:
Spencer 2016-10-19 13:37:05 -07:00 committed by GitHub
commit 3bb1224178
2 changed files with 21 additions and 1 deletions

View file

@ -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);
}
}
},

View file

@ -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) {