@@ -46,7 +46,7 @@ export function compare(e1, e2) {
46
46
}
47
47
48
48
export class DockerImage {
49
- constructor ( name , tag , { list, registryUrl, onNotify, onAuthentication } ) {
49
+ constructor ( name , tag , { list, registryUrl, onNotify, onAuthentication, addNoCacheHeader } ) {
50
50
this . name = name ;
51
51
this . tag = tag ;
52
52
this . chars = 0 ;
@@ -55,6 +55,7 @@ export class DockerImage {
55
55
registryUrl,
56
56
onNotify,
57
57
onAuthentication,
58
+ addNoCacheHeader,
58
59
} ;
59
60
this . ociImage = false ;
60
61
observable ( this ) ;
@@ -143,6 +144,9 @@ export class DockerImage {
143
144
'application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json' +
144
145
( self . opts . list ? ', application/vnd.docker.distribution.manifest.list.v2+json' : '' )
145
146
) ;
147
+ if ( self . opts . addNoCacheHeader ) {
148
+ oReq . setRequestHeader ( 'Cache-Control' , 'no-store, no-cache' ) ;
149
+ }
146
150
oReq . send ( ) ;
147
151
}
148
152
getBlobs ( blob ) {
@@ -165,7 +169,9 @@ export class DockerImage {
165
169
self . trigger ( 'creation-date' , self . creationDate ) ;
166
170
self . trigger ( 'blobs' , self . blobs ) ;
167
171
} else if ( this . status === 404 ) {
168
- self . opts . onNotify ( `Blobs for ${ self . name } :${ self . tag } not found` , true ) ;
172
+ self . opts . onNotify ( `Blobs for ${ self . name } :${ self . tag } not found: blob '${ self . blobs } '` , true ) ;
173
+ } else if ( ! this . responseText ) {
174
+ self . opts . onNotify ( `Can"t get blobs for ${ self . name } :${ self . tag } : blob '${ self . blobs } ' (no message error)` , true ) ;
169
175
} else {
170
176
self . opts . onNotify ( this . responseText ) ;
171
177
}
0 commit comments