1
0
Fork 0
mirror of https://git.42l.fr/neil/sncf.git synced 2024-04-24 18:40:29 +02:00

compatibility with nextcloud 22 and Forms API v1.1

This commit is contained in:
neil 2021-10-11 16:54:55 +02:00
parent 8d67cb340c
commit 11504c00e0
3 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "sncf"
version = "1.4.0"
version = "1.5.0"
authors = ["Association 42l <contact@noreply.example.org>"]
edition = "2018"
@ -24,7 +24,7 @@ serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
chrono = { version = "0.4", features = ["serde"] }
regex = "1.3"
regex = "1.5"
base64 = "0.13"
rand = "0.8"
askama = "0.10"

View file

@ -79,7 +79,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 == "/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
let response_body = res.body().limit(PAYLOAD_LIMIT).await.map_err(|e| {
eprintln!("error_forward_resp: {}", e);
@ -100,7 +100,7 @@ pub async fn forward(
form_id
);
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,
&url,
&client,

View file

@ -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 {
"/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,
}
}