mirror of
https://git.42l.fr/neil/sncf.git
synced 2024-05-04 06:53:12 +02:00
compatibility with nextcloud 22 and Forms API v1.1
This commit is contained in:
parent
8d67cb340c
commit
11504c00e0
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sncf"
|
name = "sncf"
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
authors = ["Association 42l <contact@noreply.example.org>"]
|
authors = ["Association 42l <contact@noreply.example.org>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ serde = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
regex = "1.3"
|
regex = "1.5"
|
||||||
base64 = "0.13"
|
base64 = "0.13"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
askama = "0.10"
|
askama = "0.10"
|
||||||
|
|
|
@ -79,7 +79,7 @@ pub async fn forward(
|
||||||
// sparing the use of a mutable body when not needed
|
// sparing the use of a mutable body when not needed
|
||||||
// For now, the body only needs to be modified when the route
|
// For now, the body only needs to be modified when the route
|
||||||
// is "create a new form" route
|
// is "create a new form" route
|
||||||
if route == "/ocs/v2.php/apps/forms/api/v1/form" {
|
if route == "/ocs/v2.php/apps/forms/api/v1.1/form" {
|
||||||
// retreive the body from the request result
|
// retreive the body from the request result
|
||||||
let response_body = res.body().limit(PAYLOAD_LIMIT).await.map_err(|e| {
|
let response_body = res.body().limit(PAYLOAD_LIMIT).await.map_err(|e| {
|
||||||
eprintln!("error_forward_resp: {}", e);
|
eprintln!("error_forward_resp: {}", e);
|
||||||
|
@ -100,7 +100,7 @@ pub async fn forward(
|
||||||
form_id
|
form_id
|
||||||
);
|
);
|
||||||
let update_req = forge_from(
|
let update_req = forge_from(
|
||||||
"/ocs/v2.php/apps/forms/api/v1/form/update",
|
"/ocs/v2.php/apps/forms/api/v1.1/form/update",
|
||||||
&req,
|
&req,
|
||||||
&url,
|
&url,
|
||||||
&client,
|
&client,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use crate::debug;
|
||||||
// if it returns true, cancels the request
|
// if it returns true, cancels the request
|
||||||
pub fn check_request(route: &str, body: &web::Bytes) -> bool {
|
pub fn check_request(route: &str, body: &web::Bytes) -> bool {
|
||||||
match route {
|
match route {
|
||||||
"/ocs/v2.php/apps/forms/api/v1/form/update" => rq_form_update(body),
|
"/ocs/v2.php/apps/forms/api/v1.1/form/update" => rq_form_update(body),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue