mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28: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
|
||||
if (redirect_uris) {
|
||||
try {
|
||||
const redirect_uri = new URL(redirect_uris);
|
||||
|
||||
if (redirect_uri.origin === "null") {
|
||||
return errorResponse(
|
||||
"Redirect URI must be an absolute URI",
|
||||
422,
|
||||
);
|
||||
}
|
||||
} catch {
|
||||
if (!URL.canParse(redirect_uris)) {
|
||||
return errorResponse("Redirect URI must be a valid URI", 422);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue