File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/core/server/elasticsearch/client Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,42 @@ describe('configureClient', () => {
179179 ` ) ;
180180 } ) ;
181181
182+ it ( 'properly encode queries' , ( ) => {
183+ const client = configureClient (
184+ createFakeConfig ( {
185+ logQueries : true ,
186+ } ) ,
187+ { logger, scoped : false }
188+ ) ;
189+
190+ const response = createApiResponse ( {
191+ body : { } ,
192+ statusCode : 200 ,
193+ params : {
194+ method : 'GET' ,
195+ path : '/foo' ,
196+ querystring : { city : 'Münich' } ,
197+ } ,
198+ } ) ;
199+
200+ client . emit ( 'response' , null , response ) ;
201+
202+ expect ( loggingSystemMock . collect ( logger ) . debug ) . toMatchInlineSnapshot ( `
203+ Array [
204+ Array [
205+ "200
206+ GET /foo
207+ city=M%C3%BCnich",
208+ Object {
209+ "tags": Array [
210+ "query",
211+ ],
212+ },
213+ ],
214+ ]
215+ ` ) ;
216+ } ) ;
217+
182218 it ( 'logs queries even in case of errors if `logQueries` is true' , ( ) => {
183219 const client = configureClient (
184220 createFakeConfig ( {
You can’t perform that action at this time.
0 commit comments