@@ -383,7 +383,7 @@ impl<'cfg> HttpRegistry<'cfg> {
383383 }
384384 let config_json_path = self
385385 . assert_index_locked ( & self . index_path )
386- . join ( "config.json" ) ;
386+ . join ( RegistryConfig :: NAME ) ;
387387 match fs:: read ( & config_json_path) {
388388 Ok ( raw_data) => match serde_json:: from_slice ( & raw_data) {
389389 Ok ( json) => {
@@ -404,12 +404,12 @@ impl<'cfg> HttpRegistry<'cfg> {
404404 fn config ( & mut self ) -> Poll < CargoResult < & RegistryConfig > > {
405405 debug ! ( "loading config" ) ;
406406 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 ( ) {
409409 return Poll :: Ready ( Ok ( self . registry_config . as_ref ( ) . unwrap ( ) ) ) ;
410410 }
411411
412- match ready ! ( self . load( Path :: new( "" ) , Path :: new( "config.json" ) , None ) ?) {
412+ match ready ! ( self . load( Path :: new( "" ) , Path :: new( RegistryConfig :: NAME ) , None ) ?) {
413413 LoadResponse :: Data {
414414 raw_data,
415415 index_version : _,
@@ -543,7 +543,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
543543 }
544544 StatusCode :: Unauthorized
545545 if !self . auth_required
546- && path == Path :: new ( "config.json" )
546+ && path == Path :: new ( RegistryConfig :: NAME )
547547 && self . config . cli_unstable ( ) . registry_auth =>
548548 {
549549 debug ! ( "re-attempting request for config.json with authorization included." ) ;
@@ -593,7 +593,7 @@ impl<'cfg> RegistryData for HttpRegistry<'cfg> {
593593 }
594594 }
595595
596- if path != Path :: new ( "config.json" ) {
596+ if path != Path :: new ( RegistryConfig :: NAME ) {
597597 self . auth_required = ready ! ( self . config( ) ?) . auth_required ;
598598 } else if !self . auth_required {
599599 // Check if there's a cached config that says auth is required.
0 commit comments