DC-044: fix slice(13) -> slice(12) for /api/v1/auth/totp/check-session drift
Slice(13) was off by one — it dropped the leading '/' before 'totp/' producing /api/v1totp/check-session. Should be slice(12) so the '/' stays.
This commit is contained in:
@@ -220,8 +220,8 @@ async function createApp() {
|
|||||||
req.url = '/api/v1' + req.url.slice(9); // '/api/auth'.length === 9
|
req.url = '/api/v1' + req.url.slice(9); // '/api/auth'.length === 9
|
||||||
} else if (req.url.startsWith('/api/v1/auth/totp/check-session')) {
|
} else if (req.url.startsWith('/api/v1/auth/totp/check-session')) {
|
||||||
// Drift: /api/v1/auth/totp/check-session -> /api/v1/totp/check-session
|
// Drift: /api/v1/auth/totp/check-session -> /api/v1/totp/check-session
|
||||||
// Drop the '/api/v1' prefix AND the '/auth' middle segment (13 chars total).
|
// Drop the '/api/v1/auth' prefix (12 chars), keep the leading '/'.
|
||||||
req.url = '/api/v1' + req.url.slice(13); // '/api/v1/auth'.length === 13
|
req.url = '/api/v1' + req.url.slice(12); // '/api/v1/auth'.length === 12
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user