From abd6c910130f60d2d60e3f72678fd20ed78614fd Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 8 Sep 2020 18:48:47 +0200 Subject: [PATCH] moving to forms OCSv2 API --- src/forward.rs | 4 ++-- src/sniff.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/forward.rs b/src/forward.rs index 2e5c056..42d777d 100644 --- a/src/forward.rs +++ b/src/forward.rs @@ -70,7 +70,7 @@ pub async fn forward( // sparing the use of a mutable body when not needed // For now, the body only needs to be modified when the route // is "create a new form" route - if route == "/apps/forms/api/v1/form" { + if route == "/ocs/v2.php/apps/forms/api/v1/form" { // retreive the body from the request result let response_body = res.body().limit(PAYLOAD_LIMIT).await.map_err(|e| { eprintln!("error_forward_resp: {}", e); @@ -90,7 +90,7 @@ pub async fn forward( r#"{{"id":{},"keyValuePairs":{{"isAnonymous":true}}}}"#, form_id ); - let update_req = forge_from("/apps/forms/api/v1/form/update", &req, &url, &client) + let update_req = forge_from("/ocs/v2.php/apps/forms/api/v1/form/update", &req, &url, &client) .set_header("content-length", forged_body.len()) .set_header("content-type", "application/json;charset=utf-8"); diff --git a/src/sniff.rs b/src/sniff.rs index 6c02301..0aef0dc 100644 --- a/src/sniff.rs +++ b/src/sniff.rs @@ -7,7 +7,7 @@ use crate::debug; // if it returns true, cancels the request pub fn check_request(route: &str, body: &web::Bytes) -> bool { match route { - "/apps/forms/api/v1/form/update" => rq_form_update(body), + "/ocs/v2.php/apps/forms/api/v1/form/update" => rq_form_update(body), _ => false, } }