Strip the `sia://` prefix.
This commit is contained in:
parent
6f408e49c9
commit
87a3cb8aa7
|
@ -79,7 +79,10 @@ server.use(
|
||||||
userRes.redirect(307, `${userReq.path}/`);
|
userRes.redirect(307, `${userReq.path}/`);
|
||||||
}
|
}
|
||||||
if (headers.location && headers.location.match(startsWithSkylinkRegExp)) {
|
if (headers.location && headers.location.match(startsWithSkylinkRegExp)) {
|
||||||
headers.location = headers.location.replace(startsWithSkylinkRegExp, `/hns/${userReq.params.name}`);
|
headers.location = headers.location.replace(
|
||||||
|
startsWithSkylinkRegExp,
|
||||||
|
`/hns/${userReq.params.name.replace("sia://", "")}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return headers;
|
return headers;
|
||||||
|
|
Reference in New Issue