From 2a89528b8f9479e59b9119bf24f6bd492263aeca Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Sat, 10 May 2025 17:56:17 +0200 Subject: [PATCH] POC in Rust remove authorization in /api/station/register --- POC_in_rust/src/main.rs | 16 ++-------------- log.json | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/POC_in_rust/src/main.rs b/POC_in_rust/src/main.rs index a8756db..350a163 100644 --- a/POC_in_rust/src/main.rs +++ b/POC_in_rust/src/main.rs @@ -57,24 +57,12 @@ struct RegisterRacer{ } async fn station_register(card_id: usize, time: DateTime::) -> 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() diff --git a/log.json b/log.json index 0637a08..fb83aa3 100644 --- a/log.json +++ b/log.json @@ -1 +1 @@ -[] \ No newline at end of file +[{"url": "https://beta.alkator.cz/api/card/register", "json": {"racer_id": 60, "starting_number": 2, "card_id": 1364550814, "time": "10.05.2025 17:40:13.486403"}}, {"url": "https://beta.alkator.cz/api/station/register", "json": {"card_id": 1364550814, "time": "10.05.2025 17:42:45.425016", "station_id": 1}}] \ No newline at end of file