tangled
alpha
login
or
join now
openstatus.dev
/
openstatus
6
fork
atom
Openstatus
www.openstatus.dev
6
fork
atom
overview
issues
pulls
pipelines
chore: more logs
Maximilian Kaske
5 months ago
524a924c
de9ff826
+6
1 changed file
expand all
collapse all
unified
split
apps
status-page
src
middleware.ts
+6
apps/status-page/src/middleware.ts
···
31
31
type = "pathname";
32
32
}
33
33
34
34
+
console.log({ pathname: url.pathname, type });
35
35
+
34
36
if (url.pathname === "/" && type !== "hostname") {
35
37
return response;
36
38
}
···
42
44
sql`lower(${page.slug}) = ${prefix} OR lower(${page.customDomain}) = ${prefix}`,
43
45
)
44
46
.get();
47
47
+
48
48
+
console.log({ slug: _page?.slug, customDomain: _page?.customDomain });
45
49
46
50
if (!_page) {
47
51
// return NextResponse.redirect(new URL("https://stpg.dev"));
···
74
78
}
75
79
76
80
const proxy = req.headers.get("x-proxy");
81
81
+
console.log({ proxy });
82
82
+
77
83
if (proxy) {
78
84
return NextResponse.rewrite(new URL(`/${prefix}${url.pathname}`, req.url));
79
85
}