POC in Rust remove authorization in /api/station/register
This commit is contained in:
@@ -57,24 +57,12 @@ struct RegisterRacer{
|
||||
}
|
||||
|
||||
async fn station_register(card_id: usize, time: DateTime::<Local>) -> Result<(), reqwest::Error>{
|
||||
let client = reqwest::Client::builder()
|
||||
.cookie_store(true)
|
||||
.build()
|
||||
.unwrap();
|
||||
let result = client
|
||||
.post(CONFIG.HOST.clone() + "/api/login")
|
||||
.form(&[
|
||||
("login", CONFIG.LOGIN.as_str()),
|
||||
("password", CONFIG.PASSWORD.as_str()),
|
||||
]);
|
||||
.send()
|
||||
.await?;
|
||||
let register_racer = RegisterRacer{
|
||||
card_id: card_id,
|
||||
station_id: CONFIG.STATION_ID,
|
||||
time: format!("{}", time.format("%d.%m.%Y %H:%M:%S.%f")),
|
||||
time: format!("{}", time.format("%d.%m.%Y %H:%M:%S.%6f")),
|
||||
};
|
||||
client
|
||||
Client::new()
|
||||
.post(CONFIG.HOST.clone() + "/api/station/register")
|
||||
.json(®ister_racer)
|
||||
.send()
|
||||
|
||||
Reference in New Issue
Block a user