mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-29 00:19:54 +03:00
Update version 0.2.1: Fix issue #18
Fix `UNAUTHORIZED` error message popping up when browsing
This commit is contained in:
parent
2d9b3886de
commit
36cbda1263
8 changed files with 230 additions and 111 deletions
|
@ -29,14 +29,14 @@ Http.prototype.addEventListener = function(e, f) {
|
|||
self.oReq.addEventListener('loadend', function() {
|
||||
if (this.status == 401) {
|
||||
var req = new XMLHttpRequest();
|
||||
for (key in this.http._events) {
|
||||
req.addEventListener(key, this.http._events[key]);
|
||||
for (key in self._events) {
|
||||
req.addEventListener(key, self._events[key]);
|
||||
}
|
||||
for (key in this.http._headers) {
|
||||
req.setRequestHeader(key, this.http._headers[key]);
|
||||
for (key in self._headers) {
|
||||
req.setRequestHeader(key, self._headers[key]);
|
||||
}
|
||||
req.withCredentials = true;
|
||||
req.open(this.http._method, this.http._url);
|
||||
req.open(self._method, self._url);
|
||||
req.send();
|
||||
} else {
|
||||
f.bind(this)();
|
||||
|
@ -44,6 +44,15 @@ Http.prototype.addEventListener = function(e, f) {
|
|||
});
|
||||
break;
|
||||
}
|
||||
case 'load':
|
||||
{
|
||||
self.oReq.addEventListener('load', function() {
|
||||
if (this.status !== 401) {
|
||||
f.bind(this)();
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
self.oReq.addEventListener(e, function() {
|
||||
|
@ -66,6 +75,5 @@ Http.prototype.open = function(m, u) {
|
|||
};
|
||||
|
||||
Http.prototype.send = function() {
|
||||
this.oReq.http = this;
|
||||
this.oReq.send();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue