Skip to content

Commit

Permalink
fix go escaping error for uppercase repos
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Jul 26, 2024
1 parent 88741bc commit 5c3765e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function splitPlainText(str: string): string[] {
}

async function fetchGoVersionInfo(modulePath: string, version: string, agentOpts: AgentOptions, proxyUrl: string) {
const url = `${proxyUrl}/${modulePath}/${version === "latest" ? "@latest" : `@v/${version}.info`}`;
const url = `${proxyUrl}/${modulePath.toLowerCase()}/${version === "latest" ? "@latest" : `@v/${version}.info`}`;
const res = await doFetch(url, getFetchOpts(agentOpts));
if ([404, 410].includes(res.status) && proxyUrl !== defaultGoProxy) {
return fetchGoVersionInfo(modulePath, version, agentOpts, defaultGoProxy);
Expand Down

0 comments on commit 5c3765e

Please sign in to comment.