@aws-sdk/util-endpoints 3.178.0 → 3.182.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.182.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.181.0...v3.182.0) (2022-09-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **endpoint:** misc fixes for endpoints 2.0 based on service unit tests ([#4002](https://github.com/aws/aws-sdk-js-v3/issues/4002)) ([77788f9](https://github.com/aws/aws-sdk-js-v3/commit/77788f9a9c7274d0cdec7832b6ed72325c9262e6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.178.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.177.0...v3.178.0) (2022-09-23)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidHostLabel = void 0;
|
|
4
|
-
const VALID_HOST_LABEL_REGEX = new RegExp(`^(
|
|
4
|
+
const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
|
|
5
5
|
const isValidHostLabel = (value, allowSubDomains = false) => {
|
|
6
6
|
if (!allowSubDomains) {
|
|
7
7
|
return VALID_HOST_LABEL_REGEX.test(value);
|
|
@@ -6,7 +6,13 @@ const evaluateExpression_1 = require("./evaluateExpression");
|
|
|
6
6
|
const getEndpointUrl = (endpointUrl, options) => {
|
|
7
7
|
const expression = (0, evaluateExpression_1.evaluateExpression)(endpointUrl, "Endpoint URL", options);
|
|
8
8
|
if (typeof expression === "string") {
|
|
9
|
-
|
|
9
|
+
try {
|
|
10
|
+
return new URL(expression);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
console.error(`Failed to construct URL with ${expression}`, error);
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
10
16
|
}
|
|
11
17
|
throw new types_1.EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
|
|
12
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __values } from "tslib";
|
|
2
|
-
var VALID_HOST_LABEL_REGEX = new RegExp("^(
|
|
2
|
+
var VALID_HOST_LABEL_REGEX = new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$");
|
|
3
3
|
export var isValidHostLabel = function (value, allowSubDomains) {
|
|
4
4
|
var e_1, _a;
|
|
5
5
|
if (allowSubDomains === void 0) { allowSubDomains = false; }
|
|
@@ -3,7 +3,13 @@ import { evaluateExpression } from "./evaluateExpression";
|
|
|
3
3
|
export var getEndpointUrl = function (endpointUrl, options) {
|
|
4
4
|
var expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
|
|
5
5
|
if (typeof expression === "string") {
|
|
6
|
-
|
|
6
|
+
try {
|
|
7
|
+
return new URL(expression);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
console.error("Failed to construct URL with ".concat(expression), error);
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
14
|
throw new EndpointError("Endpoint URL must be a string, got ".concat(typeof expression));
|
|
9
15
|
};
|