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:
1 parent
e639554587
commit
ead7afed1a
1 file changed
+1
-1
+1
-1
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user