luci-base: luci.js: support registering request progress handlers

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-09-03 16:48:03 +02:00
parent 88969529f1
commit d5e6688072

View file

@ -378,6 +378,9 @@
contenttype = opt.headers[header];
}
if ('progress' in opt && 'upload' in opt.xhr)
opt.xhr.upload.addEventListener('progress', opt.progress);
if (contenttype != null)
opt.xhr.setRequestHeader('Content-Type', contenttype);