mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-23 11:21:26 +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 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import type { Request, Response } from "express";
|
import type { Request, Response } from "express";
|
||||||
import { LemmyHttp } from "lemmy-js-client";
|
import { LemmyHttp } from "lemmy-js-client";
|
||||||
import { getHttpBaseInternal } from "../../shared/env";
|
import { getHttpBaseExternal, getHttpBaseInternal } from "../../shared/env";
|
||||||
import { wrapClient } from "../../shared/services/HttpService";
|
import { wrapClient } from "../../shared/services/HttpService";
|
||||||
import generateManifestJson from "../utils/generate-manifest-json";
|
import generateManifestJson from "../utils/generate-manifest-json";
|
||||||
import { setForwardedHeaders } from "../utils/set-forwarded-headers";
|
import { setForwardedHeaders } from "../utils/set-forwarded-headers";
|
||||||
|
@ -9,7 +9,7 @@ let manifest: Awaited<ReturnType<typeof generateManifestJson>> | undefined =
|
||||||
undefined;
|
undefined;
|
||||||
|
|
||||||
export default async (req: Request, res: Response) => {
|
export default async (req: Request, res: Response) => {
|
||||||
if (!manifest) {
|
if (!manifest || manifest.start_url !== getHttpBaseExternal()) {
|
||||||
const headers = setForwardedHeaders(req.headers);
|
const headers = setForwardedHeaders(req.headers);
|
||||||
const client = wrapClient(
|
const client = wrapClient(
|
||||||
new LemmyHttp(getHttpBaseInternal(), { fetchFunction: fetch, headers })
|
new LemmyHttp(getHttpBaseInternal(), { fetchFunction: fetch, headers })
|
||||||
|
|
Loading…
Reference in a new issue