We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe11fb9 commit 24d4858Copy full SHA for 24d4858
npm-packages/dashboard-self-hosted/src/pages/_app.tsx
@@ -64,7 +64,11 @@ function App({
64
App.getInitialProps = async ({ ctx }: { ctx: { req?: any } }) => {
65
// On server-side, get from process.env
66
if (ctx.req) {
67
- const deploymentUrl = process.env.NEXT_PUBLIC_DEPLOYMENT_URL;
+ // Tolerate a trailing slash on the url e.g. https://example.com/ should be valid and stripped to https://example.com
68
+ const deploymentUrl = process.env.NEXT_PUBLIC_DEPLOYMENT_URL?.replace(
69
+ /\/$/,
70
+ "",
71
+ );
72
if (!deploymentUrl) {
73
throw new Error(
74
"NEXT_PUBLIC_DEPLOYMENT_URL environment variable is not set",
0 commit comments