mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
Absolute URI fixes
This commit is contained in:
parent
1115b72ca6
commit
ba712a33f3
|
|
@ -29,16 +29,7 @@ export default apiRoute<{
|
||||||
|
|
||||||
// Check if redirect URI is a valid URI, and also an absolute URI
|
// Check if redirect URI is a valid URI, and also an absolute URI
|
||||||
if (redirect_uris) {
|
if (redirect_uris) {
|
||||||
try {
|
if (!URL.canParse(redirect_uris)) {
|
||||||
const redirect_uri = new URL(redirect_uris);
|
|
||||||
|
|
||||||
if (redirect_uri.origin === "null") {
|
|
||||||
return errorResponse(
|
|
||||||
"Redirect URI must be an absolute URI",
|
|
||||||
422,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
return errorResponse("Redirect URI must be a valid URI", 422);
|
return errorResponse("Redirect URI must be a valid URI", 422);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue