mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-08-25 16:05:39 -04:00
more error handling
This commit is contained in:
+23
-17
@@ -58,7 +58,23 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
headers: async () => [
|
||||
{
|
||||
// matches any path without a file extension (aka period) or an underscore (e.g. /_next/image)
|
||||
// matches any path
|
||||
source: "/(.*)",
|
||||
headers: [
|
||||
{
|
||||
key: "strict-transport-security",
|
||||
value: "max-age=63072000; includeSubDomains; preload",
|
||||
},
|
||||
{
|
||||
key: "x-got-milk",
|
||||
value: "2%",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// https://community.torproject.org/onion-services/advanced/onion-location/
|
||||
// only needed on actual pages, not static assets, so make a best effort by matching any path **without** a file
|
||||
// extension (aka a period) and/or an underscore (e.g. /_next/image).
|
||||
source: "/:path([^._]*)",
|
||||
headers: [
|
||||
{
|
||||
@@ -67,15 +83,6 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: "/pubkey.asc",
|
||||
headers: [
|
||||
{
|
||||
key: "Content-Type",
|
||||
value: "text/plain; charset=utf-8",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
rewrites: async () => [
|
||||
{
|
||||
@@ -88,6 +95,11 @@ const nextConfig: NextConfig = {
|
||||
source: "/tweets/:path*",
|
||||
destination: "https://tweets-khaki.vercel.app/:path*",
|
||||
},
|
||||
{
|
||||
source: "/pubkey.asc",
|
||||
destination:
|
||||
"https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x3bc6e5776bf379d36f6714802b0c9cf251e69a39",
|
||||
},
|
||||
],
|
||||
redirects: async () => [
|
||||
{ source: "/y2k", destination: "https://y2k.pages.dev", permanent: false },
|
||||
@@ -231,10 +243,4 @@ const nextPlugins: Array<
|
||||
|
||||
// eslint-disable-next-line import/no-anonymous-default-export
|
||||
export default (): NextConfig =>
|
||||
nextPlugins.reduce((acc, next) => {
|
||||
if (Array.isArray(next)) {
|
||||
return next[0](acc, next[1]);
|
||||
}
|
||||
|
||||
return next(acc);
|
||||
}, nextConfig);
|
||||
nextPlugins.reduce((acc, plugin) => (Array.isArray(plugin) ? plugin[0](acc, plugin[1]) : plugin(acc)), nextConfig);
|
||||
|
||||
Reference in New Issue
Block a user