Add /imaging route for avatar proxy and prevent redirect loops
Local Build and Deploy / deploy (push) Successful in 1m10s
Local Build and Deploy / deploy (push) Successful in 1m10s
This commit is contained in:
1 parent
169f658097
commit
71f154cf52
3 files changed
+116
-2
No files matched your search
+2
-2
@@ -20,12 +20,12 @@ export const HABBO_IMAGER_URL =
|
||||
*/
|
||||
export function resolveImagerBase(configured?: string | null): string {
|
||||
const fromEnv = process.env.NEXT_PUBLIC_IMAGER_URL?.trim();
|
||||
if (fromEnv && !fromEnv.includes("/api/imaging/avatar")) {
|
||||
if (fromEnv && !fromEnv.includes("/api/imaging/avatar") && !fromEnv.includes("/imaging")) {
|
||||
return fromEnv.replace(/\/+$/, "");
|
||||
}
|
||||
|
||||
const v = (configured ?? "").trim();
|
||||
if (!v || v.includes("/api/imaging/avatar")) {
|
||||
if (!v || v.includes("/api/imaging/avatar") || v.includes("/imaging")) {
|
||||
return HABBO_IMAGER_URL;
|
||||
}
|
||||
return v.replace(/\/+$/, "");
|
||||
|
||||
Reference in new issue
Block a user