refactor: improve storage handling, UI feedback, and defaults
- Update default admin email to admin@datastack.dev - Improve storage flush logic with partial success handling - Enhance CSV download reliability using fetch and Blob - Adjust simulator protocol resolution and timing - Fix date range filtering in data API query
This commit is contained in:
1 parent
40a6855724
commit
3ad9b1d4d2
17 files changed
+281
-78
No files matched your search
+10
-4
@@ -74,11 +74,17 @@ export async function middleware(request: NextRequest) {
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
const isHeadlessAdminClient =
|
||||
request.headers.get("x-datastack-admin-client") === "true" ||
|
||||
Boolean(request.headers.get("user-agent")?.startsWith("DataStack-CLI"));
|
||||
|
||||
if (isStateChangingApi && !isSameOriginRequest(request)) {
|
||||
return NextResponse.json(
|
||||
{ error: "Cross-origin request rejected." },
|
||||
{ status: 403 },
|
||||
);
|
||||
if (!isHeadlessAdminClient) {
|
||||
return NextResponse.json(
|
||||
{ error: "Cross-origin request rejected." },
|
||||
{ status: 403 },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (pathname === "/api/events" && request.method === "POST") {
|
||||
|
||||
Reference in new issue
Block a user