Skip to content

Commit

Permalink
axiologic-pla/dev#5 bug fixed smartUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
asaccool committed Feb 1, 2023
1 parent 6e3bdc8 commit b45fd1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions apihub-root/lightweight-pwa/js/services/LeafletService.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ class LeafletService {
smartUrl = smartUrl.concatWith(`&batch=${this.batch}`);
}

let header = new Headers();
header.append("epiProtocolVersion", environment.epiProtocolVersion || "1");
let header = {"epiProtocolVersion": environment.epiProtocolVersion || "1"};

return smartUrl.getRequest({
method: "GET", headers: header
Expand Down
5 changes: 4 additions & 1 deletion apihub-root/lightweight-pwa/js/utils/LightSmartUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ function SmartUrl(bdnsEntry){
let url = typeof bdnsEntry === "string" ? bdnsEntry : bdnsEntry.url;

function getOptions(options){
let opts = options || {headers:{}};
let opts = options || {};
if(!opts.headers){
opts.headers = {};
}
if(url !== bdnsEntry && bdnsEntry.headers){
Object.assign(opts.headers, bdnsEntry.headers);
}
Expand Down

0 comments on commit b45fd1f

Please sign in to comment.