From 8bff61ab7111fde6066305e18cb9acc69e8896b6 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 12 May 2021 13:02:42 -0700 Subject: [PATCH] * Fixed issue where put requests weren't firing with the optional body parameter This also "fixes" the /neighbor/update route conveniently enough, which had much better behavior than expected before. - Remvoing some fluff from debugging --- json-api/client-tests/request.py | 2 +- json-api/src/messages.rs | 1 - json-api/src/meta.rs | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/json-api/client-tests/request.py b/json-api/client-tests/request.py index 1979d47..17c3c21 100644 --- a/json-api/client-tests/request.py +++ b/json-api/client-tests/request.py @@ -41,7 +41,7 @@ class Request: elif self.method == 'delete': self.response = requests.delete(self.url, headers=self.headers, params=self.qs) elif self.method == 'put': - self.response = requests.put(self.url, headers=self.headers, params=self.qs) + self.response = requests.put(self.url, headers=self.headers, params=self.qs, data=self.body) return self.response except Exception as e: diff --git a/json-api/src/messages.rs b/json-api/src/messages.rs index e38e2dc..1edcd6a 100644 --- a/json-api/src/messages.rs +++ b/json-api/src/messages.rs @@ -7,7 +7,6 @@ use serde_json::json; use std::collections::HashMap; use crate::http::set_json_body; -use crate::perms; use crate::qs_param; use db::Message; diff --git a/json-api/src/meta.rs b/json-api/src/meta.rs index 3f12b8c..cb6bd42 100644 --- a/json-api/src/meta.rs +++ b/json-api/src/meta.rs @@ -101,8 +101,6 @@ pub async fn update_neighbor(p: &Pool, response: &mut Response, params: Ha let s: String = String::from_utf8_lossy(&body).to_string(); let json: JsonResult = serde_json::from_str(&s); - println!("\tjson result: {:?}", json); - println!("\tbody {}", s); // Verify query string parameter **and** body before attempting to reach database match (target, json) { (Some(target_url), Ok(neighbor)) => {