mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Include status in result log
This commit is contained in:
parent
042745a4be
commit
30e27906ec
@ -106,7 +106,7 @@ export function handleApiRequest(handler: (req: NextRequest, options: any, reque
|
||||
if ([301, 302].includes(res.status)) {
|
||||
throw new StackAssertionError("HTTP status codes 301 and 302 should not be returned by our APIs because the behavior for non-GET methods is inconsistent across implementations. Use 303 (to rewrite method to GET) or 307/308 (to preserve the original method and data) instead.", { status: res.status, url: req.nextUrl, req, res });
|
||||
}
|
||||
if (!disableExtendedLogging) console.log(`[ RES] [${requestId}] ${req.method} ${censoredUrl} (in ${time.toFixed(0)}ms)`);
|
||||
if (!disableExtendedLogging) console.log(`[ RES] [${requestId}] ${req.method} ${censoredUrl}: ${res.status} (in ${time.toFixed(0)}ms)`);
|
||||
return res;
|
||||
} catch (e) {
|
||||
let statusError: StatusError;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user