@@ -391,16 +391,18 @@ export class RESTDebugPanel {
391
391
message . headersText . split ( / \r ? \n / ) . forEach ( ( line ) => {
392
392
line = line . trim ( ) ;
393
393
if ( line != "" && ! line . startsWith ( "#" ) ) {
394
- headers [ line . slice ( 0 , line . indexOf ( ":" ) ) . trim ( ) ] = line . slice ( line . indexOf ( ":" ) + 1 ) . trim ( ) ;
394
+ headers [ line . slice ( 0 , line . indexOf ( ":" ) ) . trim ( ) . toLowerCase ( ) ] = line
395
+ . slice ( line . indexOf ( ":" ) + 1 )
396
+ . trim ( ) ;
395
397
}
396
398
} ) ;
397
399
if (
398
- headers [ "Authorization " ] == undefined &&
400
+ headers [ "authorization " ] == undefined &&
399
401
typeof api . config . username === "string" &&
400
402
typeof api . config . password === "string"
401
403
) {
402
404
// Use the server connection's auth if the user didn't specify any
403
- headers [ "Authorization " ] = `Basic ${ Buffer . from ( `${ api . config . username } :${ api . config . password } ` ) . toString (
405
+ headers [ "authorization " ] = `Basic ${ Buffer . from ( `${ api . config . username } :${ api . config . password } ` ) . toString (
404
406
"base64"
405
407
) } `;
406
408
}
@@ -410,16 +412,16 @@ export class RESTDebugPanel {
410
412
// Set the Content-Type header using bodyType
411
413
switch ( message . bodyType ) {
412
414
case "JSON" :
413
- headers [ "Content-Type " ] = "application/json" ;
415
+ headers [ "content-type " ] = "application/json; charset=utf-8 " ;
414
416
break ;
415
417
case "XML" :
416
- headers [ "Content-Type " ] = "application/xml" ;
418
+ headers [ "content-type " ] = "application/xml; charset=utf-8 " ;
417
419
break ;
418
420
case "Text" :
419
- headers [ "Content-Type " ] = "text/plain" ;
421
+ headers [ "content-type " ] = "text/plain; charset=utf-8 " ;
420
422
break ;
421
423
case "HTML" :
422
- headers [ "Content-Type " ] = "text/html" ;
424
+ headers [ "content-yype " ] = "text/html; charset=utf-8 " ;
423
425
break ;
424
426
}
425
427
}
0 commit comments