File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,15 +117,13 @@ export default class NpmRegistry extends Registry {
117117 const registry = urlParts ( registryUrl ) ;
118118 const customHostSuffix = this . getRegistryOrGlobalOption ( registryUrl , 'custom-host-suffix' ) ;
119119
120- const requestToRegistryHost = ( ) => request . host === registry . host ;
121- const requestToYarn = ( ) => YARN_REGISTRY . includes ( request . host ) && DEFAULT_REGISTRY . includes ( registry . host ) ;
120+ const requestToRegistryHost = request . host === registry . host ;
121+ const requestToYarn = YARN_REGISTRY . includes ( request . host ) && DEFAULT_REGISTRY . includes ( registry . host ) ;
122+ const requestToRegistryPath = request . path . startsWith ( registry . path ) ;
123+ // For some registries, the package path does not prefix with the registry path
124+ const customHostSuffixInUse = typeof customHostSuffix === 'string' && request . host . endsWith ( customHostSuffix ) ;
122125
123- return (
124- ( requestToRegistryHost ( ) || requestToYarn ( ) ) &&
125- ( request . path . startsWith ( registry . path ) ||
126- // For some registries, the package path does not prefix with the registry path
127- ( typeof customHostSuffix === 'string' && request . host . endsWith ( customHostSuffix ) ) )
128- ) ;
126+ return ( requestToRegistryHost || requestToYarn ) && ( requestToRegistryPath || customHostSuffixInUse ) ;
129127 }
130128
131129 request ( pathname : string , opts ?: RegistryRequestOptions = { } , packageName : ?string ) : Promise < * > {
You can’t perform that action at this time.
0 commit comments