Skip to content

Commit

Permalink
[Devtools] Fix editor error while adding second request (elastic#120593)
Browse files Browse the repository at this point in the history
* Fix editor error while adding the second request

Co-authored-by: Muhammad Ibragimov <[email protected]>
  • Loading branch information
2 people authored and TinLe committed Dec 22, 2021
1 parent a0ea27a commit bcc732b
Showing 1 changed file with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2022,22 +2022,37 @@ ace.define(
},
// parses and returns the method
method = function () {
const [first, ...rest] = text.split(' ');
text = first.toUpperCase() + rest.join(' ');
ch = ch.toUpperCase();

switch (ch) {
case 'g':
next('g');
next('e');
next('t');
return 'get';
case 'G':
next('G');
next('E');
next('T');
return 'GET';
case 'h':
next('h');
next('e');
next('a');
next('d');
return 'head';
case 'H':
next('H');
next('E');
next('A');
next('D');
return 'HEAD';
case 'd':
next('d');
next('e');
next('l');
next('e');
next('t');
next('e');
return 'delete';
case 'D':
next('D');
next('E');
Expand All @@ -2046,6 +2061,22 @@ ace.define(
next('T');
next('E');
return 'DELETE';
case 'p':
next('p');
switch (ch) {
case 'u':
next('u');
next('t');
return 'put';
case 'o':
next('o');
next('s');
next('t');
return 'post';
default:
error('Unexpected \'' + ch + '\'');
}
break;
case 'P':
next('P');
switch (ch) {
Expand Down

0 comments on commit bcc732b

Please sign in to comment.