From 9915e9af23c303c49e27cb05e335d20393abd456 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 29 May 2020 18:31:20 +0200 Subject: [PATCH] Fix error --- src/data/http_request_handler.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/data/http_request_handler.rs b/src/data/http_request_handler.rs index 063c75c..787acca 100644 --- a/src/data/http_request_handler.rs +++ b/src/data/http_request_handler.rs @@ -112,8 +112,11 @@ impl HttpRequestHandler { } /// Forbidden (401) + /// + /// I did not the HTTP official specs when I made this choice of using Unauthorized instead + /// of Forbidden. Today it would be really complicated to come back... pub fn forbidden(&mut self, message: String) -> RequestResult { - self.response = Some(HttpResponse::Forbidden().json( + self.response = Some(HttpResponse::Unauthorized().json( HttpError::forbidden(&message))); Err(Box::new(ExecError::new(&message))) }