[pbs-devel] [PATCH proxmox] proxmox-rest-server: do not use formatter for AuthErr

Dietmar Maurer dietmar at proxmox.com
Mon Nov 27 11:17:08 CET 2023


We want to get a 401 error at HTTP level.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 proxmox-rest-server/src/rest.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs
index 2ccd4d5..e81be44 100644
--- a/proxmox-rest-server/src/rest.rs
+++ b/proxmox-rest-server/src/rest.rs
@@ -923,7 +923,7 @@ impl Formatted {
                     // always delay unauthorized calls by 3 seconds (from start of request)
                     let err = http_err!(UNAUTHORIZED, "authentication failed - {}", err);
                     tokio::time::sleep_until(Instant::from_std(delay_unauth_time())).await;
-                    return Ok(formatter.format_error(err));
+                    return Err(err);
                 }
             }
         }
-- 
2.39.2





More information about the pbs-devel mailing list