Skip to content

Commit 4eb84c4

Browse files
committed
fix(revproxy): 🐛 Use HTTPS in productioN
1 parent bad8796 commit 4eb84c4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/routes/home.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ export async function action({ request }: Route.ActionArgs) {
4040
}
4141

4242
// Build absolute URL to API using current request URL as base
43-
const apiUrl = new URL("/api/archive/", request.url);
43+
const apiUrl = new URL("/api/archive", request.url);
44+
45+
// Ensure HTTPS in production to avoid reverse proxy POST->GET conversion
46+
if (process.env.NODE_ENV === "production") {
47+
apiUrl.protocol = "https:";
48+
}
4449

4550
try {
4651
const res = await fetch(apiUrl, {

0 commit comments

Comments
 (0)