Skip to content

Commit 582c48a

Browse files
authored
Merge pull request #70 from jdno/log-fastly-purge
Log request to purge Fastly cache
2 parents c67c538 + f626adf commit 582c48a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/fastly.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ 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);
21+
2022
self.start_new_request()?;
2123

2224
self.client.post(true)?;
23-
self.client.url(&format!(
24-
"https://api.fastly.com/purge/{}/{}",
25-
self.domain, path
26-
))?;
25+
self.client.url(&url)?;
26+
27+
println!("invalidating Fastly cache with POST '{}'", url);
2728

2829
self.client.perform().map_err(|error| error.into())
2930
}

0 commit comments

Comments
 (0)