This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextScript } from 'next/document'; | |
function dedupe<T extends { file: string }>(bundles: T[]): T[] { | |
const files = new Set<string>(); | |
const kept: T[] = []; | |
for (const bundle of bundles) { | |
if (files.has(bundle.file)) continue; | |
files.add(bundle.file); | |
kept.push(bundle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LanguageProvider = ({ children }) => { | |
const router = useRouter(); | |
const { i18n } = useTranslation(); | |
useEffect(() => { | |
const handleRouteChangeComplete = (path: string) => { | |
// Find the lng for the path | |
const findPathReturnLng = (): string => { | |
let i; | |
for (i = 0; i < routes.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type | Protocol | Port Range | Source | |
---|---|---|---|---|
All traffic | All | All | 0.0.0.0/0 | |
All traffic | All | All | ::/0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type | Protocol | Port Range | Source | |
---|---|---|---|---|
Custom UDP Rule | UDP | 51820 | 0.0.0.0/0 | |
SSH | TCP | 22 | 0.0.0.0/0 | |
Custom UDP Rule | UDP | 4500 | 0.0.0.0/0 | |
Custom UDP Rule | UDP | 500 | 0.0.0.0/0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = (event, context, callback) => { | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; | |
const user_agent = headers['user-agent']; | |
const host = headers['host']; | |
if (user_agent && host) { | |
var prerender = /googlebot|adsbot\-google|Feedfetcher\-Google|bingbot|yandex|baiduspider|Facebot|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator/i.test(user_agent[0].value); | |
prerender = prerender || /_escaped_fragment_/.test(request.querystring); | |
prerender = prerender && ! /\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|doc|txt|ico|rss|zip|mp3|rar|exe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|iso|flv|m4v|torrent|ttf|woff|svg|eot)$/i.test(request.uri); | |
if (prerender) { |