Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport] PR #8758 to 5.x - Internal server error when saving a widget with German characters in name #8761

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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