File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ impl<'c> RegistryClientCache<'c> {
145
145
let tarball_name = package. tarball_name ( ) ;
146
146
let file = self
147
147
. dl_fs
148
- . open_rw ( & tarball_name, & tarball_name, self . config ) ?;
148
+ . open_ro ( & tarball_name, & tarball_name, self . config ) ?;
149
149
let checksum = self . get_record_maybe_uncached ( package) . await ?. checksum ;
150
150
return Ok ( ( file, checksum) ) ;
151
151
}
Original file line number Diff line number Diff line change @@ -309,6 +309,15 @@ fn caching() {
309
309
. success ( )
310
310
. stdout_eq ( "" ) ;
311
311
312
+ Scarb :: quick_snapbox ( )
313
+ . arg ( "fetch" )
314
+ . env ( "SCARB_CACHE" , cache_dir. path ( ) )
315
+ . current_dir ( & t)
316
+ . timeout ( Duration :: from_secs ( 10 ) )
317
+ . assert ( )
318
+ . success ( )
319
+ . stdout_eq ( "" ) ;
320
+
312
321
let expected = expect ! [ [ r#"
313
322
GET /api/v1/index/config.json
314
323
accept: */*
@@ -365,6 +374,19 @@ fn caching() {
365
374
304 Not Modified
366
375
content-length: 0
367
376
etag: ...
377
+
378
+ ###
379
+
380
+ GET /index/3/b/bar.json
381
+ accept: */*
382
+ accept-encoding: gzip, br, deflate
383
+ host: ...
384
+ if-none-match: ...
385
+ user-agent: ...
386
+
387
+ 304 Not Modified
388
+ content-length: 0
389
+ etag: ...
368
390
"# ] ] ;
369
391
expected. assert_eq ( & registry. logs ( ) ) ;
370
392
}
You can’t perform that action at this time.
0 commit comments