Skip to content

Commit

Permalink
Merge pull request elastic#8761 from elastic/jasper/backport/8758/5.x
Browse files Browse the repository at this point in the history
[backport] PR elastic#8758 to 5.x - Internal server error when saving a widget with German characters in name
  • Loading branch information
spalger authored Oct 19, 2016
2 parents 1171461 + afbc790 commit 2c0a221
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/core_plugins/elasticsearch/lib/create_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
},
Expand Down
10 changes: 10 additions & 0 deletions test/functional/apps/visualize/_area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2c0a221

Please sign in to comment.