fix: added dot boundary to amazonaws.com endsWith checks to ensure url authenticity

Signed-off-by: Travis O'Neal <wtravisoneal@gmail.com>
This commit is contained in:
Travis O'Neal
2026-03-26 22:26:57 -04:00
parent 6e2aaabdf3
commit ac7c3a21d2
@@ -75,8 +75,10 @@ export function parseUrl(
// Treat Amazon hosted separately because it has special region logic
if (
config.host.endsWith('amazonaws.com') ||
config.host.endsWith('amazonaws.com.cn')
config.host === 'amazonaws.com' ||
config.host === 'amazonaws.com.cn' ||
config.host.endsWith('.amazonaws.com') ||
config.host.endsWith('.amazonaws.com.cn')
) {
const match = host.match(
/^(?:([a-z0-9.-]+)\.)?s3(?:[.-]([a-z0-9-]+))?\.amazonaws\.com(\.cn)?$/,