mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-27 19:09:12 +00:00
Regenerate manifest on HTTPBase external change (#1459)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
cf857b4eca
commit
cda9bd0a79
|
@ -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 })
|
||||
|
|
Loading…
Reference in a new issue