File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -466,7 +466,7 @@ export default class ApiRequest extends LitElement {
466
466
}
467
467
//Generate URL using Path Params
468
468
pathParamEls . map ( function ( el ) {
469
- fetchUrl = fetchUrl . replace ( "{" + el . dataset . pname + "}" , el . value ) ;
469
+ fetchUrl = fetchUrl . replace ( "{" + el . dataset . pname + "}" , encodeURIComponent ( el . value ) ) ;
470
470
} ) ;
471
471
472
472
//Submit Query Params
@@ -475,13 +475,13 @@ export default class ApiRequest extends LitElement {
475
475
queryParamEls . map ( function ( el ) {
476
476
if ( el . dataset . array === 'false' ) {
477
477
if ( el . value !== '' ) {
478
- queryParam . append ( el . dataset . pname , el . value ) ;
478
+ queryParam . append ( el . dataset . pname , encodeURIComponent ( el . value ) ) ;
479
479
}
480
480
}
481
481
else {
482
482
let vals = el . getValues ( ) ;
483
483
for ( let v of vals ) {
484
- queryParam . append ( el . dataset . pname , v ) ;
484
+ queryParam . append ( el . dataset . pname , encodeURIComponent ( v ) ) ;
485
485
}
486
486
}
487
487
} )
@@ -490,7 +490,7 @@ export default class ApiRequest extends LitElement {
490
490
491
491
// Add authentication Query-Param if provided
492
492
if ( this . apiKeyValue && this . apiKeyName && this . apiKeyLocation === 'query' ) {
493
- fetchUrl = `${ fetchUrl } &${ this . apiKeyName } =${ this . apiKeyValue } ` ;
493
+ fetchUrl = `${ fetchUrl } &${ this . apiKeyName } =${ encodeURIComponent ( this . apiKeyValue ) } ` ;
494
494
}
495
495
496
496
//Final URL for API call
You can’t perform that action at this time.
0 commit comments