Compare commits

...

2 commits

Author SHA1 Message Date
ItsDrike 939ae84a10
Better success msg 2024-04-18 22:22:34 +02:00
ItsDrike cfafabc3d8
Fix success detection 2024-04-18 22:22:16 +02:00
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ fn main() {
while let Some(edit_code) = edit_codes.next() { while let Some(edit_code) = edit_codes.next() {
match edit_paste(&client, &csrf_data, &edit_code, PASTE_NAME) { match edit_paste(&client, &csrf_data, &edit_code, PASTE_NAME) {
Ok(_) => { Ok(_) => {
println!("Paste deleted successfully with edit code: {edit_code}"); println!("Success, found edit code: {edit_code}");
return; return;
} }
Err(e) => match e { Err(e) => match e {

View file

@ -150,7 +150,7 @@ pub fn edit_paste(
if res.status().is_redirection() { if res.status().is_redirection() {
let location = res.headers().get("Location").unwrap().to_str().unwrap(); let location = res.headers().get("Location").unwrap().to_str().unwrap();
if location == "/" { if location == "/".to_owned() + paste_name {
return Ok(()); return Ok(());
} }
} }