1 | export const getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => {
|
2 | if (signingRegion) {
|
3 | return signingRegion;
|
4 | }
|
5 | else if (useFipsEndpoint) {
|
6 | const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\.");
|
7 | const regionRegexmatchArray = hostname.match(regionRegexJs);
|
8 | if (regionRegexmatchArray) {
|
9 | return regionRegexmatchArray[0].slice(1, -1);
|
10 | }
|
11 | }
|
12 | };
|