]> Untitled Git - lemmy-ui.git/commitdiff
Fix httpBase
authorDessalines <tyhou13@gmx.com>
Mon, 26 Apr 2021 19:32:59 +0000 (15:32 -0400)
committerDessalines <tyhou13@gmx.com>
Mon, 26 Apr 2021 19:32:59 +0000 (15:32 -0400)
src/server/index.tsx
src/shared/env.ts

index 1c58ca8c51b7d09bd65a639f77b6f3d08e700eeb..2d2a6624f7915f23095828a68bb301f5ae0ba5ca 100644 (file)
@@ -16,7 +16,7 @@ import { GetSite, GetSiteResponse, LemmyHttp } from "lemmy-js-client";
 import process from "process";
 import { Helmet } from "inferno-helmet";
 import { initializeSite } from "../shared/initialize";
-import { httpBase } from "../shared/env";
+import { httpBaseInternal } from "../shared/env";
 import { IncomingHttpHeaders } from "http";
 import { setOptionalAuth } from "../shared/utils";
 
@@ -44,7 +44,7 @@ server.get("/*", async (req, res) => {
   let headers = setForwardedHeaders(req.headers);
 
   let initialFetchReq: InitialFetchRequest = {
-    client: new LemmyHttp(httpBase, headers),
+    client: new LemmyHttp(httpBaseInternal, headers),
     auth,
     path: req.path,
   };
index 0b094ced01fdbc1ef1188c16825ab9a1853e75dd..505b5c1b0d88249b377c4743bd95b4b07c5a3241 100644 (file)
@@ -33,9 +33,10 @@ if (isBrowser()) {
   secure = process.env.LEMMY_HTTPS == "true" ? "s" : "";
 }
 
-export const httpBase = `http://${host}`; // Don't use secure here
+export const httpBaseInternal = `http://${host}`; // Don't use secure here
+export const httpBase = `http${secure}://${host}`;
 export const wsUri = `ws${secure}://${wsHost}/api/v3/ws`;
-export const pictrsUri = `http${secure}://${host}/pictrs/image`;
+export const pictrsUri = `${httpBase}/pictrs/image`;
 
 console.log(`httpbase: ${httpBase}`);
 console.log(`wsUri: ${wsUri}`);