Potential fix for code scanning alert no. 11: Incomplete regular expression for hostnames

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
xixu-meandCopilot Autofix powered by AI authored and GitHub committed 2025-12-08 20:05:05 +08:00
1 parent e639554587
commit ead7afed1a
1 file changed
+1 -1
+1 -1
View File
@@ -1245,7 +1245,7 @@ async function handleRequest(request, env, ctx) {
// Rewrite URLs in the response body to go through the Cloudflare Workers
// files.pythonhosted.org URLs should be rewritten to go through our pypi/files endpoint
const rewrittenText = originalText.replace(
/https:\/\/files.pythonhosted.org/g,
/https:\/\/files\.pythonhosted\.org/g,
`${url.origin}/pypi/files`
);
responseBody = new ReadableStream({