Fix pagination URLs when behind SSL-terminating reverse proxy

This commit is contained in:
Zoe Roux
2025-11-13 14:02:37 +01:00
parent f4b1ab5fa0
commit 5e63b57440
13 changed files with 190 additions and 47 deletions
+8 -4
View File
@@ -67,7 +67,7 @@ export const historyH = new Elysia({ tags: ["profiles"] })
"/profiles/me/history",
async ({
query: { sort, filter, query, limit, after },
headers: { "accept-language": languages },
headers: { "accept-language": languages, ...headers },
request: { url },
jwt: { sub },
}) => {
@@ -87,7 +87,7 @@ export const historyH = new Elysia({ tags: ["profiles"] })
progressQ: historyProgressQ,
})) as Entry[];
return createPage(items, { url, sort, limit });
return createPage(items, { url, sort, limit, headers });
},
{
detail: {
@@ -109,7 +109,11 @@ export const historyH = new Elysia({ tags: ["profiles"] })
async ({
params: { id },
query: { sort, filter, query, limit, after },
headers: { "accept-language": languages, authorization },
headers: {
"accept-language": languages,
authorization,
...headers
},
request: { url },
status,
}) => {
@@ -132,7 +136,7 @@ export const historyH = new Elysia({ tags: ["profiles"] })
progressQ: historyProgressQ,
})) as Entry[];
return createPage(items, { url, sort, limit });
return createPage(items, { url, sort, limit, headers });
},
{
detail: {
+2 -2
View File
@@ -69,7 +69,7 @@ export const nextup = new Elysia({ tags: ["profiles"] })
"/profiles/me/nextup",
async ({
query: { sort, filter, query, limit, after },
headers: { "accept-language": languages },
headers: { "accept-language": languages, ...headers },
request: { url },
jwt: { sub },
}) => {
@@ -124,7 +124,7 @@ export const nextup = new Elysia({ tags: ["profiles"] })
.limit(limit)
.execute({ userId: sub });
return createPage(items, { url, sort, limit });
return createPage(items, { url, sort, limit, headers });
},
{
detail: {
+8 -4
View File
@@ -142,7 +142,7 @@ export const watchlistH = new Elysia({ tags: ["profiles"] })
"/profiles/me/watchlist",
async ({
query: { limit, after, query, sort, filter, preferOriginal },
headers: { "accept-language": languages },
headers: { "accept-language": languages, ...headers },
request: { url },
jwt: { sub, settings },
}) => {
@@ -162,7 +162,7 @@ export const watchlistH = new Elysia({ tags: ["profiles"] })
relations: ["nextEntry"],
userId: sub,
});
return createPage(items, { url, sort, limit });
return createPage(items, { url, sort, limit, headers });
},
{
detail: { description: "Get all movies/series in your watchlist" },
@@ -195,7 +195,11 @@ export const watchlistH = new Elysia({ tags: ["profiles"] })
params: { id },
query: { limit, after, query, sort, filter, preferOriginal },
jwt: { settings },
headers: { "accept-language": languages, authorization },
headers: {
"accept-language": languages,
authorization,
...headers
},
request: { url },
status,
}) => {
@@ -218,7 +222,7 @@ export const watchlistH = new Elysia({ tags: ["profiles"] })
relations: ["nextEntry"],
userId: uInfo.id,
});
return createPage(items, { url, sort, limit });
return createPage(items, { url, sort, limit, headers });
},
{
detail: {