@platformatic/composer 2.36.2 → 2.37.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 +7 -4
- package/package.json +12 -11
- package/schema.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -138,7 +138,7 @@ module.exports = fp(async function (app, opts) {
|
|
|
138
138
|
})
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
const toReplace = url
|
|
141
|
+
const toReplace = url ? new RegExp(url.replace(/127\.0\.0\.1/, 'localhost').replace(/\[::\]/, 'localhost').replace('http://', 'https?://')) : null
|
|
142
142
|
|
|
143
143
|
const proxyOptions = {
|
|
144
144
|
websocket: true,
|
|
@@ -156,8 +156,10 @@ module.exports = fp(async function (app, opts) {
|
|
|
156
156
|
rewriteHeaders: (headers) => {
|
|
157
157
|
let location = headers.location
|
|
158
158
|
if (location) {
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
if (toReplace) {
|
|
160
|
+
location = location.replace(toReplace, '')
|
|
161
|
+
}
|
|
162
|
+
if (!urlPattern.test(location) && internalRewriteLocationHeader) {
|
|
161
163
|
location = location.replace(rewritePrefix, prefix)
|
|
162
164
|
}
|
|
163
165
|
headers.location = location
|
|
@@ -183,7 +185,8 @@ module.exports = fp(async function (app, opts) {
|
|
|
183
185
|
...headers,
|
|
184
186
|
...telemetryHeaders,
|
|
185
187
|
'x-forwarded-for': request.ip,
|
|
186
|
-
'x-forwarded-host': request.host
|
|
188
|
+
'x-forwarded-host': request.host,
|
|
189
|
+
'x-forwarded-proto': request.protocol,
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
return headers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/composer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
"json-schema-to-typescript": "^15.0.0",
|
|
25
25
|
"neostandard": "^0.12.0",
|
|
26
26
|
"openapi-schema-validator": "^12.1.3",
|
|
27
|
+
"self-cert": "^2.0.0",
|
|
27
28
|
"single-user-cache": "^1.0.1",
|
|
28
29
|
"split2": "^4.2.0",
|
|
29
30
|
"tsd": "^0.31.0",
|
|
30
31
|
"typescript": "^5.5.4",
|
|
31
32
|
"why-is-node-running": "2",
|
|
32
33
|
"ws": "^8.16.0",
|
|
33
|
-
"@platformatic/config": "2.
|
|
34
|
-
"@platformatic/
|
|
35
|
-
"@platformatic/
|
|
34
|
+
"@platformatic/config": "2.37.1",
|
|
35
|
+
"@platformatic/db": "2.37.1",
|
|
36
|
+
"@platformatic/client": "2.37.1"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@fastify/error": "^4.0.0",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"@fastify/static": "^8.0.0",
|
|
42
43
|
"@fastify/swagger": "^9.0.0",
|
|
43
44
|
"@fastify/view": "^10.0.1",
|
|
45
|
+
"@platformatic/fastify-openapi-glue": "^5.0.0",
|
|
44
46
|
"@platformatic/graphql-composer": "^0.10.0",
|
|
45
47
|
"@scalar/fastify-api-reference": "^1.19.5",
|
|
46
48
|
"ajv": "^8.12.0",
|
|
@@ -51,7 +53,6 @@
|
|
|
51
53
|
"execa": "^9.0.0",
|
|
52
54
|
"fast-deep-equal": "^3.1.3",
|
|
53
55
|
"fastify": "^5.0.0",
|
|
54
|
-
"@platformatic/fastify-openapi-glue": "^5.0.0",
|
|
55
56
|
"fastify-plugin": "^5.0.0",
|
|
56
57
|
"graphql": "^16.8.1",
|
|
57
58
|
"help-me": "^5.0.0",
|
|
@@ -66,12 +67,12 @@
|
|
|
66
67
|
"rfdc": "^1.3.1",
|
|
67
68
|
"semgrator": "^0.3.0",
|
|
68
69
|
"undici": "^7.0.0",
|
|
69
|
-
"@platformatic/config": "2.
|
|
70
|
-
"@platformatic/generators": "2.
|
|
71
|
-
"@platformatic/
|
|
72
|
-
"@platformatic/
|
|
73
|
-
"@platformatic/utils": "^2.
|
|
74
|
-
"@platformatic/
|
|
70
|
+
"@platformatic/config": "2.37.1",
|
|
71
|
+
"@platformatic/generators": "2.37.1",
|
|
72
|
+
"@platformatic/scalar-theme": "2.37.1",
|
|
73
|
+
"@platformatic/service": "2.37.1",
|
|
74
|
+
"@platformatic/utils": "^2.37.1",
|
|
75
|
+
"@platformatic/telemetry": "2.37.1"
|
|
75
76
|
},
|
|
76
77
|
"scripts": {
|
|
77
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.37.1.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Composer",
|
|
5
5
|
"type": "object",
|