Skip to content

Commit f69c202

Browse files
authored
fix: incorrect host when running tests
As noted in #493 (comment), the recorded `http-data` in `src/tests` expects "http://alexcrichton-test.s3.amazonaws.com". But, as the `S3_REGION` env var is loaded as `Some("")`, it matches wrong leading to wrong host "http://alexcrichton-test-.s3.amazonaws.com". This fixes it by handling match when region is empty.
1 parent 4f9aeb3 commit f69c202

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/s3/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ impl Bucket {
9999
pub fn host(&self) -> String {
100100
format!("{}.s3{}.amazonaws.com", self.name,
101101
match self.region {
102-
Some(ref r) => format!("-{}", r),
102+
Some(ref r) if r != "" => format!("-{}", r),
103+
Some(_) => String::new(),
103104
None => String::new(),
104105
})
105106
}

0 commit comments

Comments
 (0)