Skip to content

Commit 2ea4c86

Browse files
authored
Merge pull request #71 from jdno/remove-double-slashes
Remove double slashes in purge URL for Fastly
2 parents 582c48a + 9682684 commit 2ea4c86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fastly.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ impl Fastly {
1717
}
1818

1919
pub fn purge(&mut self, path: &str) -> Result<(), Error> {
20-
let url = format!("https://api.fastly.com/purge/{}/{}", self.domain, path);
20+
let sanitized_path = path.trim_start_matches('/');
21+
let url = format!(
22+
"https://api.fastly.com/purge/{}/{}",
23+
self.domain, sanitized_path
24+
);
2125

2226
self.start_new_request()?;
2327

0 commit comments

Comments
 (0)