Absolute URI fixes

This commit is contained in:
Jesse Wierzbinski 2024-04-07 02:33:55 -10:00
parent 1115b72ca6
commit ba712a33f3
No known key found for this signature in database

View file

@ -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);
} }
} }