@rpcbase/server 0.415.0 → 0.417.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.415.0",
3
+ "version": "0.417.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "scripts": {
package/src/initServer.ts CHANGED
@@ -16,6 +16,7 @@ process.env = {
16
16
  import { getDerivedKey } from "./getDerivedKey"
17
17
  import { metricsIngestProxyMiddleware } from "./metricsIngestProxyMiddleware"
18
18
 
19
+
19
20
  const isProduction = process.env.NODE_ENV === "production"
20
21
 
21
22
 
@@ -47,11 +48,11 @@ export const initServer = async (app: Application, serverEnv: { [key: string]:
47
48
  // redirect www to non-www middleware
48
49
  app.use((req, res, next) => {
49
50
  if (req.headers.host?.startsWith("www.")) {
50
- const newHost = req.headers.host.replace("www.", "");
51
- return res.redirect(301, `${req.protocol}://${newHost}${req.originalUrl}`);
51
+ const newHost = req.headers.host.replace("www.", "")
52
+ return res.redirect(301, `${req.protocol}://${newHost}${req.originalUrl}`)
52
53
  }
53
- next();
54
- });
54
+ next()
55
+ })
55
56
 
56
57
  metricsIngestProxyMiddleware(app)
57
58
 
@@ -1,7 +1,8 @@
1
1
  // types/session.d.ts
2
2
  import "express-session"
3
3
 
4
- import { SessionUser } from "./index";
4
+ import { SessionUser } from "./index"
5
+
5
6
 
6
7
  declare module "express-session" {
7
8
  interface SessionData {