diff --git a/.gitignore b/.gitignore index 43f25aa7..6a4f2eb0 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,4 @@ docker/data # Cache files __pycache__ /.idea/ +/venv/ diff --git a/handshake-api/index.js b/handshake-api/index.js index 452d50c7..87b5a09a 100644 --- a/handshake-api/index.js +++ b/handshake-api/index.js @@ -20,7 +20,7 @@ const clientOptions = { const client = new NodeClient(clientOptions); // Match both `sia://HASH` and `HASH` links. -const startsWithSkylinkRegExp = /^(sia:\/\/){0,1}[a-zA-Z0-9_-]{46}/; +const startsWithSkylinkRegExp = /^(sia:\/\/)?[a-zA-Z0-9_-]{46}/; const getDomainRecords = async (name) => { const response = await client.execute("getnameresource", [name]); @@ -75,9 +75,6 @@ server.use( proxy("nginx", { // eslint-disable-next-line no-unused-vars userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes) { - // if (!userReq.url.endsWith('/')) { - // userRes.redirect(307, `${userReq.url}/`); - // } if (headers.location && headers.location.match(startsWithSkylinkRegExp)) { headers.location = headers.location.replace( startsWithSkylinkRegExp,