]> Untitled Git - lemmy-ui.git/commitdiff
Regenerate manifest on HTTPBase external change (#1459)
authorSleeplessOne1917 <abias1122@gmail.com>
Thu, 22 Jun 2023 02:45:21 +0000 (02:45 +0000)
committerGitHub <noreply@github.com>
Thu, 22 Jun 2023 02:45:21 +0000 (22:45 -0400)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
src/server/handlers/manifest-handler.ts

index 55c7b64fead6aa0af2ffabb7a5984c4cc54b8cd0..6858cffd569e7a28e69effc780eaa11bcfdcee10 100644 (file)
@@ -1,6 +1,6 @@
 import type { Request, Response } from "express";
 import { LemmyHttp } from "lemmy-js-client";
-import { getHttpBaseInternal } from "../../shared/env";
+import { getHttpBaseExternal, getHttpBaseInternal } from "../../shared/env";
 import { wrapClient } from "../../shared/services/HttpService";
 import generateManifestJson from "../utils/generate-manifest-json";
 import { setForwardedHeaders } from "../utils/set-forwarded-headers";
@@ -9,7 +9,7 @@ let manifest: Awaited<ReturnType<typeof generateManifestJson>> | undefined =
   undefined;
 
 export default async (req: Request, res: Response) => {
-  if (!manifest) {
+  if (!manifest || manifest.start_url !== getHttpBaseExternal()) {
     const headers = setForwardedHeaders(req.headers);
     const client = wrapClient(
       new LemmyHttp(getHttpBaseInternal(), { fetchFunction: fetch, headers })