File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
src/plugins/console/public/application/models/sense_editor Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,9 @@ GET index_1/type1/1/_source?_source_include=f
2525
2626DELETE index_2
2727
28+
29+ POST /_sql?format=txt
30+ {
31+ "query": "SELECT prenom FROM claude_index WHERE prenom = 'claude' ",
32+ "fetch_size": 1
33+ }
Original file line number Diff line number Diff line change @@ -470,6 +470,18 @@ curl -XGET "http://localhost:9200/_stats?level=shards"
470470curl -XPUT "http://localhost:9200/index_1/type1/1" -H 'Content-Type: application/json' -d'
471471{
472472 "f": 1
473+ }'` . trim ( )
474+ ) ;
475+
476+ multiReqCopyAsCurlTest (
477+ 'with single quotes' ,
478+ editorInput1 ,
479+ { start : { lineNumber : 29 } , end : { lineNumber : 33 } } ,
480+ `
481+ curl -XPOST "http://localhost:9200/_sql?format=txt" -H 'Content-Type: application/json' -d'
482+ {
483+ "query": "SELECT prenom FROM claude_index WHERE prenom = '\\''claude'\\'' ",
484+ "fetch_size": 1
473485}'` . trim ( )
474486 ) ;
475487} ) ;
Original file line number Diff line number Diff line change @@ -484,8 +484,9 @@ export class SenseEditor {
484484 if ( esData && esData . length ) {
485485 ret += " -H 'Content-Type: application/json' -d'\n" ;
486486 const dataAsString = collapseLiteralStrings ( esData . join ( '\n' ) ) ;
487- // since Sense doesn't allow single quote json string any single qoute is within a string.
488- ret += dataAsString . replace ( / ' / g, '\\"' ) ;
487+
488+ // We escape single quoted strings that that are wrapped in single quoted strings
489+ ret += dataAsString . replace ( / ' / g, "'\\''" ) ;
489490 if ( esData . length > 1 ) {
490491 ret += '\n' ;
491492 } // end with a new line
You can’t perform that action at this time.
0 commit comments