Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/api-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ export default class ApiRequest extends LitElement {
}
//Generate URL using Path Params
pathParamEls.map(function(el){
fetchUrl = fetchUrl.replace("{"+el.dataset.pname+"}", el.value);
fetchUrl = fetchUrl.replace("{"+el.dataset.pname+"}", encodeURIComponent(el.value));
});

//Submit Query Params
Expand All @@ -475,13 +475,13 @@ export default class ApiRequest extends LitElement {
queryParamEls.map(function(el){
if (el.dataset.array==='false'){
if (el.value !== ''){
queryParam.append(el.dataset.pname, el.value);
queryParam.append(el.dataset.pname, encodeURIComponent(el.value));
}
}
else {
let vals = el.getValues();
for(let v of vals){
queryParam.append(el.dataset.pname, v);
queryParam.append(el.dataset.pname, encodeURIComponent(v));
}
}
})
Expand All @@ -490,7 +490,7 @@ export default class ApiRequest extends LitElement {

// Add authentication Query-Param if provided
if (this.apiKeyValue && this.apiKeyName && this.apiKeyLocation==='query'){
fetchUrl = `${fetchUrl}&${this.apiKeyName}=${this.apiKeyValue}`;
fetchUrl = `${fetchUrl}&${this.apiKeyName}=${encodeURIComponent(this.apiKeyValue)}`;
}

//Final URL for API call
Expand Down