Skip to content

Commit 5cf8c6c

Browse files
committed
fix: remove <REGION> from endpoint
1 parent c4bc0ff commit 5cf8c6c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Spec/Swagger2.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,15 @@ public function getVersion()
4343
*/
4444
public function getEndpoint()
4545
{
46-
return $this->getAttribute('schemes.0', 'https') .
47-
'://' . $this->getAttribute('host', 'example.com') .
48-
$this->getAttribute('basePath', '');
46+
$scheme = $this->getAttribute('schemes.0', 'https');
47+
$host = $this->getAttribute('host', 'example.com');
48+
$basePath = $this->getAttribute('basePath', '');
49+
50+
if (str_starts_with($host, '<REGION>.')) {
51+
$host = substr($host, 9);
52+
}
53+
54+
return $scheme . '://' . $host . $basePath;
4955
}
5056

5157
/**

0 commit comments

Comments
 (0)