Skip to content

Commit 03a3540

Browse files
authored
[ES|QL] Displays the solution recommended queries for queries which start with special characters (#237575)
## Summary This PR makes sure we are encoding the querystring before sending this to the server because special characters can lead to 404 (i.e. comments in the beginning) ### Release notes This is a serverless feature, so this bug was only affecting serverless. Let's mention it only there
1 parent 2da81d6 commit 03a3540

File tree

1 file changed

+2
-1
lines changed
  • src/platform/plugins/shared/esql/public

1 file changed

+2
-1
lines changed

src/platform/plugins/shared/esql/public/plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ export class EsqlPlugin implements Plugin<{}, EsqlPluginStart> {
160160
queryString: string,
161161
activeSolutionId: SolutionId
162162
) => {
163+
const encodedQuery = encodeURIComponent(queryString);
163164
const result = await core.http.get(
164-
`${REGISTRY_EXTENSIONS_ROUTE}${activeSolutionId}/${queryString}`
165+
`${REGISTRY_EXTENSIONS_ROUTE}${activeSolutionId}/${encodedQuery}`
165166
);
166167
return result;
167168
};

0 commit comments

Comments
 (0)