@@ -383,7 +383,7 @@ impl<'cfg> HttpRegistry<'cfg> {
383
383
}
384
384
let config_json_path = self
385
385
. assert_index_locked ( & self . index_path )
386
- . join ( "config.json" ) ;
386
+ . join ( RegistryConfig :: NAME ) ;
387
387
match fs:: read ( & config_json_path) {
388
388
Ok ( raw_data) => match serde_json:: from_slice ( & raw_data) {
389
389
Ok ( json) => {
@@ -404,12 +404,12 @@ impl<'cfg> HttpRegistry<'cfg> {
404
404
fn config ( & mut self ) -> Poll < CargoResult < & RegistryConfig > > {
405
405
debug ! ( "loading config" ) ;
406
406
let index_path = self . assert_index_locked ( & self . index_path ) ;
407
- let config_json_path = index_path. join ( "config.json" ) ;
408
- if self . is_fresh ( Path :: new ( "config.json" ) ) && self . config_cached ( ) ?. is_some ( ) {
407
+ let config_json_path = index_path. join ( RegistryConfig :: NAME ) ;
408
+ if self . is_fresh ( Path :: new ( RegistryConfig :: NAME ) ) && self . config_cached ( ) ?. is_some ( ) {
409
409
return Poll :: Ready ( Ok ( self . registry_config . as_ref ( ) . unwrap ( ) ) ) ;
410
410
}
411
411
412
- match ready ! ( self . load( Path :: new( "" ) , Path :: new( "config.json" ) , None ) ?) {
412
+ match ready ! ( self . load( Path :: new( "" ) , Path :: new( RegistryConfig :: NAME ) , None ) ?) {
413
413
LoadResponse :: Data {
414
414
raw_data,
415
415
index_version : _,
@@ -543,7 +543,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
543
543
}
544
544
StatusCode :: Unauthorized
545
545
if !self . auth_required
546
- && path == Path :: new ( "config.json" )
546
+ && path == Path :: new ( RegistryConfig :: NAME )
547
547
&& self . config . cli_unstable ( ) . registry_auth =>
548
548
{
549
549
debug ! ( "re-attempting request for config.json with authorization included." ) ;
@@ -593,7 +593,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
593
593
}
594
594
}
595
595
596
- if path != Path :: new ( "config.json" ) {
596
+ if path != Path :: new ( RegistryConfig :: NAME ) {
597
597
self . auth_required = ready ! ( self . config( ) ?) . auth_required ;
598
598
} else if !self . auth_required {
599
599
// Check if there's a cached config that says auth is required.
0 commit comments