mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Fix httpBase
This commit is contained in:
parent
1119fff4d3
commit
a136d064ae
2 changed files with 5 additions and 4 deletions
|
@ -16,7 +16,7 @@ import { GetSite, GetSiteResponse, LemmyHttp } from "lemmy-js-client";
|
||||||
import process from "process";
|
import process from "process";
|
||||||
import { Helmet } from "inferno-helmet";
|
import { Helmet } from "inferno-helmet";
|
||||||
import { initializeSite } from "../shared/initialize";
|
import { initializeSite } from "../shared/initialize";
|
||||||
import { httpBase } from "../shared/env";
|
import { httpBaseInternal } from "../shared/env";
|
||||||
import { IncomingHttpHeaders } from "http";
|
import { IncomingHttpHeaders } from "http";
|
||||||
import { setOptionalAuth } from "../shared/utils";
|
import { setOptionalAuth } from "../shared/utils";
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ server.get("/*", async (req, res) => {
|
||||||
let headers = setForwardedHeaders(req.headers);
|
let headers = setForwardedHeaders(req.headers);
|
||||||
|
|
||||||
let initialFetchReq: InitialFetchRequest = {
|
let initialFetchReq: InitialFetchRequest = {
|
||||||
client: new LemmyHttp(httpBase, headers),
|
client: new LemmyHttp(httpBaseInternal, headers),
|
||||||
auth,
|
auth,
|
||||||
path: req.path,
|
path: req.path,
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,9 +33,10 @@ if (isBrowser()) {
|
||||||
secure = process.env.LEMMY_HTTPS == "true" ? "s" : "";
|
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 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(`httpbase: ${httpBase}`);
|
||||||
console.log(`wsUri: ${wsUri}`);
|
console.log(`wsUri: ${wsUri}`);
|
||||||
|
|
Loading…
Reference in a new issue