@platformatic/gateway 3.45.0 → 3.46.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
@@ -253,6 +253,7 @@ export interface PlatformaticGatewayConfig {
253
253
  upstream?: string;
254
254
  prefix?: string;
255
255
  rewritePrefix?: string;
256
+ rewriteLocationHeader?: boolean;
256
257
  hostname?: string;
257
258
  custom?: {
258
259
  path: string;
package/lib/capability.js CHANGED
@@ -41,8 +41,13 @@ export class GatewayCapability extends ServiceCapability {
41
41
 
42
42
  const url = await super.start()
43
43
 
44
- this.#runtimeEventHandler = this.#handleRuntimeEvent.bind(this)
45
- globalThis[kITC]?.on('runtime:event', this.#runtimeEventHandler)
44
+ // Only register the runtime event handler once. start() can be called
45
+ // multiple times (first with listen:false, then listen:true) so guard
46
+ // against duplicate registrations.
47
+ if (!this.#runtimeEventHandler) {
48
+ this.#runtimeEventHandler = this.#handleRuntimeEvent.bind(this)
49
+ globalThis[kITC]?.on('runtime:event', this.#runtimeEventHandler)
50
+ }
46
51
 
47
52
  return url
48
53
  }
package/lib/proxy.js CHANGED
@@ -50,6 +50,10 @@ async function resolveApplicationProxyParameters (application, root) {
50
50
  }
51
51
  }
52
52
 
53
+ if (typeof application.proxy?.rewriteLocationHeader === 'boolean') {
54
+ internalRewriteLocationHeader = application.proxy.rewriteLocationHeader
55
+ }
56
+
53
57
  const require = createRequire(import.meta.filename)
54
58
 
55
59
  if (application.proxy?.custom) {
package/lib/schema.js CHANGED
@@ -150,6 +150,7 @@ export const gateway = {
150
150
  upstream: { type: 'string' },
151
151
  prefix: { type: 'string' },
152
152
  rewritePrefix: { type: 'string' },
153
+ rewriteLocationHeader: { type: 'boolean' },
153
154
  hostname: { type: 'string' },
154
155
  custom: {
155
156
  type: 'object',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/gateway",
3
- "version": "3.45.0",
3
+ "version": "3.46.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.45.0"
35
+ "@platformatic/db": "3.46.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.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"
66
+ "@platformatic/basic": "3.46.0",
67
+ "@platformatic/scalar-theme": "3.46.0",
68
+ "@platformatic/foundation": "^3.46.0",
69
+ "@platformatic/service": "3.46.0",
70
+ "@platformatic/telemetry": "3.46.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.45.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.46.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Gateway Config",
5
5
  "type": "object",
@@ -840,6 +840,9 @@
840
840
  "rewritePrefix": {
841
841
  "type": "string"
842
842
  },
843
+ "rewriteLocationHeader": {
844
+ "type": "boolean"
845
+ },
843
846
  "hostname": {
844
847
  "type": "string"
845
848
  },