[pmg-devel] [PATCH pmg-rs 1/1] fix #3688: handle optional meta property of the directory
Dominik Csapak
d.csapak at proxmox.com
Thu Oct 21 11:10:44 CEST 2021
meta is optional so handle that, fixes the issue where one could not
create an account on custom ACME endpoints without a meta property since
it could not be parsed
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
needs proxmox-acme-rs to be bumped and the depency adapted in Cargo.toml
src/acme.rs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/acme.rs b/src/acme.rs
index 9a57624..a1b5278 100644
--- a/src/acme.rs
+++ b/src/acme.rs
@@ -265,10 +265,11 @@ pub mod export {
/// Get the directory's meta information.
#[export]
- pub fn get_meta(#[try_from_ref] this: &Acme) -> Result<Meta, Error> {
- Ok(Meta::clone(
- this.inner.lock().unwrap().client.directory()?.meta(),
- ))
+ pub fn get_meta(#[try_from_ref] this: &Acme) -> Result<Option<Meta>, Error> {
+ match this.inner.lock().unwrap().client.directory()?.meta() {
+ Some(meta) => Ok(Some(meta.clone())),
+ None => Ok(None),
+ }
}
/// Get the account's directory URL.
--
2.30.2
More information about the pmg-devel
mailing list