Files
explore/middleware.ts.orig
T
zeekay 81fe26da19 fix: Update explorer branding from Blockscout to Lux Network
- Update footer text to describe Lux Network instead of Blockscout
- Fix theme token schema to match expected format
- Update metadata description templates to use Lux Network branding
- Change footer copyright and company name to Lux Network
2025-07-13 14:07:25 -05:00

49 lines
1.3 KiB
Plaintext

import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
import generateCspPolicy from 'nextjs/csp/generateCspPolicy';
import * as middlewares from 'nextjs/middlewares/index';
const cspPolicy = generateCspPolicy();
export function middleware(req: NextRequest) {
const isPageRequest = req.headers.get('accept')?.includes('text/html');
const start = Date.now();
if (!isPageRequest) {
return;
}
const accountResponse = middlewares.account(req);
if (accountResponse) {
return accountResponse;
}
const res = NextResponse.next();
<<<<<<< HEAD
middlewares.colorTheme(req, res);
middlewares.addressFormat(req, res);
const end = Date.now();
res.headers.append('Content-Security-Policy', cspPolicy);
=======
//res.headers.append('Content-Security-Policy', cspPolicy);
>>>>>>> cfcfbe585 (lux fonts)
res.headers.append('Server-Timing', `middleware;dur=${ end - start }`);
res.headers.append('Docker-ID', process.env.HOSTNAME || '');
return res;
}
/**
* Configure which routes should pass through the Middleware.
*/
export const config = {
matcher: [ '/', '/:notunderscore((?!_next).+)' ],
// matcher: [
// '/((?!.*\\.|api\\/|node-api\\/).*)', // exclude all static + api + node-api routes
// ],
};