mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-30 08:59:54 +03:00
[delete image] Add request for deleting a manifest/image.
Add setRequestHeader in Http class.
This commit is contained in:
parent
70f860f813
commit
7150fe3245
2 changed files with 43 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
function Http() {
|
||||
this.oReq = new XMLHttpRequest();
|
||||
this._events = {};
|
||||
this._headers = {};
|
||||
}
|
||||
|
||||
Http.prototype.addEventListener = function(e, f) {
|
||||
|
@ -31,6 +32,9 @@ Http.prototype.addEventListener = function(e, f) {
|
|||
for (key in this.http._events) {
|
||||
req.addEventListener(key, this.http._events[key]);
|
||||
}
|
||||
for (key in this.http._headers) {
|
||||
req.setRequestHeader(key, this.http._headers[key]);
|
||||
}
|
||||
req.withCredentials = true;
|
||||
req.open(this.http._method, this.http._url);
|
||||
req.send();
|
||||
|
@ -50,6 +54,11 @@ Http.prototype.addEventListener = function(e, f) {
|
|||
}
|
||||
};
|
||||
|
||||
Http.prototype.setRequestHeader = function(header, value) {
|
||||
this.oReq.setRequestHeader(header, value);
|
||||
this._headers[header] = value;
|
||||
};
|
||||
|
||||
Http.prototype.open = function(m, u) {
|
||||
this._method = m;
|
||||
this._url = u;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue