tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
update for nextjs 16
awarm.space
3 months ago
58833e1f
fd2767ce
+5
-37
6 changed files
expand all
collapse all
unified
split
actions
subscriptions
sendPostToSubscribers.ts
next.config.js
package-lock.json
package.json
src
utils
getCurrentDeploymentDomain.ts
isBot.ts
+1
-1
actions/subscriptions/sendPostToSubscribers.ts
···
57
57
) {
58
58
return;
59
59
}
60
60
-
let domain = getCurrentDeploymentDomain();
60
60
+
let domain = await getCurrentDeploymentDomain();
61
61
let res = await fetch("https://api.postmarkapp.com/email/batch", {
62
62
method: "POST",
63
63
headers: {
+1
-1
next.config.js
···
31
31
{ protocol: "https", hostname: "bdefzwcumgzjwllsnaej.supabase.co" },
32
32
],
33
33
},
34
34
+
reactCompiler: true,
34
35
experimental: {
35
35
-
reactCompiler: true,
36
36
serverActions: {
37
37
bodySizeLimit: "5mb",
38
38
},
-15
package-lock.json
···
18
18
"@atproto/syntax": "^0.3.3",
19
19
"@atproto/xrpc": "^0.7.5",
20
20
"@atproto/xrpc-server": "^0.9.5",
21
21
-
"@esbuild/darwin-arm64": "^0.27.0",
22
21
"@hono/node-server": "^1.14.3",
23
22
"@mdx-js/loader": "^3.1.0",
24
23
"@mdx-js/react": "^3.1.0",
···
1431
1430
"optional": true,
1432
1431
"os": [
1433
1432
"android"
1434
1434
-
],
1435
1435
-
"engines": {
1436
1436
-
"node": ">=18"
1437
1437
-
}
1438
1438
-
},
1439
1439
-
"node_modules/@esbuild/darwin-arm64": {
1440
1440
-
"version": "0.27.0",
1441
1441
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.0.tgz",
1442
1442
-
"integrity": "sha512-uJOQKYCcHhg07DL7i8MzjvS2LaP7W7Pn/7uA0B5S1EnqAirJtbyw4yC5jQ5qcFjHK9l6o/MX9QisBg12kNkdHg==",
1443
1443
-
"cpu": [
1444
1444
-
"arm64"
1445
1445
-
],
1446
1446
-
"os": [
1447
1447
-
"darwin"
1448
1433
],
1449
1434
"engines": {
1450
1435
"node": ">=18"
-1
package.json
···
28
28
"@atproto/syntax": "^0.3.3",
29
29
"@atproto/xrpc": "^0.7.5",
30
30
"@atproto/xrpc-server": "^0.9.5",
31
31
-
"@esbuild/darwin-arm64": "^0.27.0",
32
31
"@hono/node-server": "^1.14.3",
33
32
"@mdx-js/loader": "^3.1.0",
34
33
"@mdx-js/react": "^3.1.0",
+3
-3
src/utils/getCurrentDeploymentDomain.ts
···
1
1
-
import { headers, type UnsafeUnwrappedHeaders } from "next/headers";
2
2
-
export function getCurrentDeploymentDomain() {
3
3
-
const headersList = (headers() as unknown as UnsafeUnwrappedHeaders);
1
1
+
import { headers } from "next/headers";
2
2
+
export async function getCurrentDeploymentDomain() {
3
3
+
const headersList = await headers();
4
4
const hostname = headersList.get("x-forwarded-host");
5
5
let protocol = headersList.get("x-forwarded-proto");
6
6
return `${protocol}://${hostname}/`;
-16
src/utils/isBot.ts
···
1
1
-
import { cookies, headers, type UnsafeUnwrappedHeaders } from "next/headers";
2
2
-
export function getIsBot() {
3
3
-
const userAgent =
4
4
-
(headers() as unknown as UnsafeUnwrappedHeaders).get("user-agent") || "";
5
5
-
const botPatterns = [
6
6
-
/bot/i,
7
7
-
/crawler/i,
8
8
-
/spider/i,
9
9
-
/googlebot/i,
10
10
-
/bingbot/i,
11
11
-
/yahoo/i,
12
12
-
// Add more patterns as needed
13
13
-
];
14
14
-
15
15
-
return botPatterns.some((pattern) => pattern.test(userAgent));
16
16
-
}