Revert "windows self-update"

This reverts commit cee51300b2.
This commit is contained in:
2023-06-28 15:13:41 +02:00
parent 23dc1c085c
commit 2289bcaa87
4 changed files with 4 additions and 414 deletions

View File

@@ -2,20 +2,9 @@ use std::{fs, io::Write, path::Path, str};
pub fn get_body(url: &str) -> Vec<u8> {
let mut res: Vec<u8> = Vec::new();
let req = http_req::request::Request::new(&url.try_into().unwrap())
.header(
"User-Agent",
"AlterWare Launcher | github.com/mxve/alterware-launcher",
)
.send(&mut res)
.unwrap_or_else(|error| {
panic!("\n\n{}:\n{:?}", "Error", error);
});
if req.status_code() == http_req::response::StatusCode::new(302) {
let location = req.headers().get("Location").unwrap().as_str();
return get_body(location);
}
http_req::request::get(url, &mut res).unwrap_or_else(|error| {
panic!("\n\n{}:\n{:?}", "Error", error);
});
res
}