SimpleChat: Rather need to use append to insert headers
This commit is contained in:
parent
dce4e6a64b
commit
c9559d2b26
1 changed files with 7 additions and 1 deletions
|
@ -164,6 +164,12 @@ class SimpleChat {
|
||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup the fetch headers.
|
||||||
|
* It picks the headers from gMe.headers.
|
||||||
|
* It inserts Authorization only if its non-empty.
|
||||||
|
* @param {string} apiEP
|
||||||
|
*/
|
||||||
fetch_headers(apiEP) {
|
fetch_headers(apiEP) {
|
||||||
let headers = new Headers();
|
let headers = new Headers();
|
||||||
for(let k in gMe.headers) {
|
for(let k in gMe.headers) {
|
||||||
|
@ -171,7 +177,7 @@ class SimpleChat {
|
||||||
if ((k == "Authorization") && (v.trim() == "")) {
|
if ((k == "Authorization") && (v.trim() == "")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
headers[k] = v;
|
headers.append(k, v);
|
||||||
}
|
}
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue