pmcf 6.65.4 → 6.66.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 +1 -1
- package/src/core-service.mjs +1 -1
- package/src/endpoint.mjs +19 -9
- package/src/services/openldap.mjs +1 -1
package/package.json
CHANGED
package/src/core-service.mjs
CHANGED
package/src/endpoint.mjs
CHANGED
|
@@ -174,7 +174,8 @@ export class DomainNameEndpoint extends PortEndpoint {
|
|
|
174
174
|
export class HTTPEndpoint extends BaseEndpoint {
|
|
175
175
|
static name = "url_endpoint";
|
|
176
176
|
static attributes = {
|
|
177
|
-
url: url_attribute
|
|
177
|
+
url: url_attribute,
|
|
178
|
+
addressType: { ...string_attribute, name: "addressType" }
|
|
178
179
|
};
|
|
179
180
|
|
|
180
181
|
static {
|
|
@@ -186,6 +187,7 @@ export class HTTPEndpoint extends BaseEndpoint {
|
|
|
186
187
|
* @param {Service} service
|
|
187
188
|
* @param {string|URL} address
|
|
188
189
|
* @param {object} data
|
|
190
|
+
* @param {string} data.scheme
|
|
189
191
|
* @param {number} data.port
|
|
190
192
|
* @param {string} data.pathname
|
|
191
193
|
* @param {string} data.family
|
|
@@ -198,18 +200,22 @@ export class HTTPEndpoint extends BaseEndpoint {
|
|
|
198
200
|
} else if (address instanceof URL) {
|
|
199
201
|
this.url = address;
|
|
200
202
|
} else {
|
|
203
|
+
this.networkAddress = address;
|
|
201
204
|
this.family = data.family ?? address.family;
|
|
202
205
|
|
|
206
|
+
const scheme = data.scheme ? data.scheme : data.tls ? "https" : "http";
|
|
207
|
+
|
|
208
|
+
const domainName = [...address.domainNames][0];
|
|
209
|
+
const hostname =
|
|
210
|
+
domainName ??
|
|
211
|
+
(data.family === FAMILY_IPV6
|
|
212
|
+
? "[" + address.address + "]"
|
|
213
|
+
: address.address);
|
|
214
|
+
|
|
203
215
|
this.url = new URL(
|
|
204
|
-
|
|
205
|
-
(data.family === FAMILY_IPV6
|
|
206
|
-
? "[" + address.address + "]"
|
|
207
|
-
: address.address) +
|
|
208
|
-
":" +
|
|
209
|
-
data.port +
|
|
210
|
-
(data.pathname ?? "/")
|
|
216
|
+
`${scheme}://${hostname}:${data.port}` + (data.pathname ?? "/")
|
|
211
217
|
);
|
|
212
|
-
this.hostname = address.address;
|
|
218
|
+
this.hostname = domainName ?? address.address;
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
221
|
|
|
@@ -236,6 +242,10 @@ export class HTTPEndpoint extends BaseEndpoint {
|
|
|
236
242
|
return PROTOCOL_TCP;
|
|
237
243
|
}
|
|
238
244
|
|
|
245
|
+
get addressType() {
|
|
246
|
+
return this.networkAddress?.type;
|
|
247
|
+
}
|
|
248
|
+
|
|
239
249
|
get tls() {
|
|
240
250
|
return this.url.toString().startsWith("https:");
|
|
241
251
|
}
|