Added null checks

This commit is contained in:
2019-04-19 22:12:33 +09:00
parent 912f409688
commit 707233a422
11 changed files with 94 additions and 51 deletions

View File

@ -20,8 +20,10 @@ export function uploadWithProgress(url, options: RequestInit, onProgress: ((ev:
xhr.open(options.method || "GET", url, true)
for(let k in options.headers || {}) {
xhr.setRequestHeader(k, options.headers[k])
if(options.headers) {
for(let key in options.headers) {
xhr.setRequestHeader(key, options.headers[key])
}
}
xhr.send(options.body)