@platformatic/composer 2.43.0 → 2.44.1
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/lib/proxy.js +12 -9
- package/package.json +10 -10
- package/schema.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -46,7 +46,7 @@ async function resolveServiceProxyParameters (service) {
|
|
|
46
46
|
|
|
47
47
|
module.exports = fp(async function (app, opts) {
|
|
48
48
|
const meta = { proxies: {} }
|
|
49
|
-
const
|
|
49
|
+
const hostnameLessProxies = []
|
|
50
50
|
|
|
51
51
|
for (const service of opts.services) {
|
|
52
52
|
if (!service.proxy) {
|
|
@@ -207,7 +207,7 @@ module.exports = fp(async function (app, opts) {
|
|
|
207
207
|
|
|
208
208
|
return headers
|
|
209
209
|
},
|
|
210
|
-
onResponse: (
|
|
210
|
+
onResponse: (_, reply, res) => {
|
|
211
211
|
app.openTelemetry?.endHTTPSpanClient(reply.request.proxedCallSpan, {
|
|
212
212
|
statusCode: reply.statusCode,
|
|
213
213
|
headers: res.headers
|
|
@@ -217,8 +217,9 @@ module.exports = fp(async function (app, opts) {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
hostnameLessProxies.push(proxyOptions)
|
|
221
|
+
|
|
220
222
|
const host = service.proxy?.hostname
|
|
221
|
-
const notHost = allDomains.filter(d => d !== host)
|
|
222
223
|
|
|
223
224
|
if (host) {
|
|
224
225
|
await app.register(httpProxy, {
|
|
@@ -226,14 +227,16 @@ module.exports = fp(async function (app, opts) {
|
|
|
226
227
|
prefix: '/',
|
|
227
228
|
constraints: { host }
|
|
228
229
|
})
|
|
230
|
+
}
|
|
231
|
+
}
|
|
229
232
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
} else {
|
|
235
|
-
await app.register(httpProxy, proxyOptions)
|
|
233
|
+
const hostnames = opts.services.map(s => s.proxy?.hostname).filter(Boolean)
|
|
234
|
+
for (const options of hostnameLessProxies) {
|
|
235
|
+
if (hostnames.length > 0) {
|
|
236
|
+
options.constraints = { notHost: hostnames }
|
|
236
237
|
}
|
|
238
|
+
|
|
239
|
+
await app.register(httpProxy, options)
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
opts.context?.stackable?.registerMeta(meta)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/composer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"typescript": "^5.5.4",
|
|
32
32
|
"why-is-node-running": "2",
|
|
33
33
|
"ws": "^8.16.0",
|
|
34
|
-
"@platformatic/client": "2.
|
|
35
|
-
"@platformatic/
|
|
36
|
-
"@platformatic/
|
|
34
|
+
"@platformatic/client": "2.44.1",
|
|
35
|
+
"@platformatic/config": "2.44.1",
|
|
36
|
+
"@platformatic/db": "2.44.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@fastify/error": "^4.0.0",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"rfdc": "^1.3.1",
|
|
68
68
|
"semgrator": "^0.3.0",
|
|
69
69
|
"undici": "^7.0.0",
|
|
70
|
-
"@platformatic/config": "2.
|
|
71
|
-
"@platformatic/generators": "2.
|
|
72
|
-
"@platformatic/scalar-theme": "2.
|
|
73
|
-
"@platformatic/telemetry": "2.
|
|
74
|
-
"@platformatic/service": "2.
|
|
75
|
-
"@platformatic/utils": "^2.
|
|
70
|
+
"@platformatic/config": "2.44.1",
|
|
71
|
+
"@platformatic/generators": "2.44.1",
|
|
72
|
+
"@platformatic/scalar-theme": "2.44.1",
|
|
73
|
+
"@platformatic/telemetry": "2.44.1",
|
|
74
|
+
"@platformatic/service": "2.44.1",
|
|
75
|
+
"@platformatic/utils": "^2.44.1"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"test": "pnpm run lint && borp -T --timeout=300000 -c 1 && tsd",
|
package/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/composer/2.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/composer/2.44.1.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Composer",
|
|
5
5
|
"type": "object",
|