@platformatic/gateway 3.44.0 → 3.45.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/config.d.ts CHANGED
@@ -252,6 +252,7 @@ export interface PlatformaticGatewayConfig {
252
252
  routes?: string[];
253
253
  upstream?: string;
254
254
  prefix?: string;
255
+ rewritePrefix?: string;
255
256
  hostname?: string;
256
257
  custom?: {
257
258
  path: string;
package/lib/proxy.js CHANGED
@@ -31,7 +31,7 @@ async function resolveApplicationProxyParameters (application, root) {
31
31
 
32
32
  // If no prefix could be found, assume the application id
33
33
  let prefix = (application.proxy?.prefix ?? meta.prefix ?? application.id).replace(/(\/$)/g, '')
34
- let rewritePrefix = ''
34
+ let rewritePrefix = application.proxy?.rewritePrefix ?? ''
35
35
  let internalRewriteLocationHeader = true
36
36
 
37
37
  if (meta.wantsAbsoluteUrls) {
@@ -44,8 +44,10 @@ async function resolveApplicationProxyParameters (application, root) {
44
44
 
45
45
  // The rewritePrefix purposely ignores application.proxy?.prefix to let
46
46
  // the application always being able to configure their value
47
- rewritePrefix = meta.prefix ?? application.id
48
- internalRewriteLocationHeader = false
47
+ if (!application.proxy?.rewritePrefix) {
48
+ rewritePrefix = meta.prefix ?? application.id
49
+ internalRewriteLocationHeader = false
50
+ }
49
51
  }
50
52
 
51
53
  const require = createRequire(import.meta.filename)
package/lib/schema.js CHANGED
@@ -149,6 +149,7 @@ export const gateway = {
149
149
  },
150
150
  upstream: { type: 'string' },
151
151
  prefix: { type: 'string' },
152
+ rewritePrefix: { type: 'string' },
152
153
  hostname: { type: 'string' },
153
154
  custom: {
154
155
  type: 'object',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/gateway",
3
- "version": "3.44.0",
3
+ "version": "3.45.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "typescript": "^5.5.4",
33
33
  "why-is-node-running": "2",
34
34
  "ws": "^8.16.0",
35
- "@platformatic/db": "3.44.0"
35
+ "@platformatic/db": "3.45.0"
36
36
  },
37
37
  "dependencies": {
38
38
  "@fastify/error": "^4.0.0",
@@ -63,11 +63,11 @@
63
63
  "rfdc": "^1.3.1",
64
64
  "semgrator": "^0.3.0",
65
65
  "undici": "^7.0.0",
66
- "@platformatic/basic": "3.44.0",
67
- "@platformatic/foundation": "^3.44.0",
68
- "@platformatic/scalar-theme": "3.44.0",
69
- "@platformatic/service": "3.44.0",
70
- "@platformatic/telemetry": "3.44.0"
66
+ "@platformatic/basic": "3.45.0",
67
+ "@platformatic/foundation": "^3.45.0",
68
+ "@platformatic/scalar-theme": "3.45.0",
69
+ "@platformatic/service": "3.45.0",
70
+ "@platformatic/telemetry": "3.45.0"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.44.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.45.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Gateway Config",
5
5
  "type": "object",
@@ -837,6 +837,9 @@
837
837
  "prefix": {
838
838
  "type": "string"
839
839
  },
840
+ "rewritePrefix": {
841
+ "type": "string"
842
+ },
840
843
  "hostname": {
841
844
  "type": "string"
842
845
  },