Skip to content
Snippets Groups Projects
Unverified Commit 6de815e8 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

fix(rubygems): Cache versions endpoing only for `rubygems.org` host (#22906)

parent a51d6d94
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ import type { HttpOptions } from '../../../util/http/types'; ...@@ -6,6 +6,7 @@ import type { HttpOptions } from '../../../util/http/types';
import { newlineRegex } from '../../../util/regex'; import { newlineRegex } from '../../../util/regex';
import { LooseArray } from '../../../util/schema-utils'; import { LooseArray } from '../../../util/schema-utils';
import { copystr } from '../../../util/string'; import { copystr } from '../../../util/string';
import { parseUrl } from '../../../util/url';
interface VersionsEndpointUnsupported { interface VersionsEndpointUnsupported {
versionsEndpointSupported: false; versionsEndpointSupported: false;
...@@ -155,7 +156,11 @@ export class VersionsEndpointCache { ...@@ -155,7 +156,11 @@ export class VersionsEndpointCache {
} else { } else {
newCache = oldCache; newCache = oldCache;
} }
memCache.set(cacheKey, newCache);
const registryHostname = parseUrl(registryUrl)?.hostname;
if (registryHostname === 'rubygems.org') {
memCache.set(cacheKey, newCache);
}
return newCache; return newCache;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment