Skip to content

Commit 6dd77be

Browse files
committed
revise check and make it case insensitive
1 parent f02fbfc commit 6dd77be

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/mockserver.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ async function mockserver() {
111111
requestXml.includes('<Surname>')
112112
) {
113113
const match = requestXml.match('<Surname>(.*?)<');
114-
if('Carlsson'.includes(match)){
115-
responsePath = 'src/responses/user/Carlsson.xml';
114+
if(('carlsson').startsWith(match[1].toLowerCase())){
115+
responsePath = 'src/responses/user/' + method + '/Carlsson.xml';
116116
}
117-
else if('Beckley'.includes(match)){
118-
responsePath = 'src/responses/user/Beckley.xml';
117+
else if(('beckley').startsWith(match[1].toLowerCase())){
118+
responsePath = 'src/responses/user/' + method + '/Beckley.xml';
119119
}
120-
else if ('Nilsson'.includes(match)){
121-
responsePath = 'src/responses/user/Nilsson.xml';
120+
else if (('nilsson').startsWith(match[1].toLowerCase())){
121+
responsePath = 'src/responses/user/' + method + '/Nilsson.xml';
122122
}
123123
else{
124124
responsePath = 'src/responses/user/' + method + '.xml';

0 commit comments

Comments
 (0)