mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 10:35:56 +01:00 
			
		
		
		
	Fetch authorization exceptions
This commit is contained in:
		| @@ -4,6 +4,7 @@ import com.google.inject.Inject; | |||||||
| import com.google.inject.Singleton; | import com.google.inject.Singleton; | ||||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||||
| import org.apache.http.HttpStatus; | import org.apache.http.HttpStatus; | ||||||
|  | import org.apache.shiro.authz.AuthorizationException; | ||||||
| import sonia.scm.NotFoundException; | import sonia.scm.NotFoundException; | ||||||
| import sonia.scm.PushStateDispatcher; | import sonia.scm.PushStateDispatcher; | ||||||
| import sonia.scm.filter.WebElement; | import sonia.scm.filter.WebElement; | ||||||
| @@ -74,6 +75,9 @@ public class HttpProtocolServlet extends HttpServlet { | |||||||
|     } catch (NotFoundException e) { |     } catch (NotFoundException e) { | ||||||
|       log.debug(e.getMessage()); |       log.debug(e.getMessage()); | ||||||
|       resp.setStatus(HttpStatus.SC_NOT_FOUND); |       resp.setStatus(HttpStatus.SC_NOT_FOUND); | ||||||
|  |     } catch (AuthorizationException e) { | ||||||
|  |       log.debug(e.getMessage()); | ||||||
|  |       resp.setStatus(HttpStatus.SC_FORBIDDEN); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user