Compare commits
2 commits
a6581455e7
...
939ae84a10
Author | SHA1 | Date | |
---|---|---|---|
ItsDrike | 939ae84a10 | ||
ItsDrike | cfafabc3d8 |
|
@ -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 {
|
||||||
|
|
|
@ -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(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue