mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2026-05-21 04:32:51 +00:00
[delete image] Add request for deleting a manifest/image.
Add setRequestHeader in Http class.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user