diff options
5 files changed, 11 insertions, 15 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java index e8d809659b..d33362b4b4 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java @@ -87,9 +87,9 @@ class AsIsFileFilter implements Filter { asIs.access(req, db); chain.doFilter(request, response); } catch (ServiceNotAuthorizedException e) { - res.sendError(SC_UNAUTHORIZED); + res.sendError(SC_UNAUTHORIZED, e.getMessage()); } catch (ServiceNotEnabledException e) { - res.sendError(SC_FORBIDDEN); + res.sendError(SC_FORBIDDEN, e.getMessage()); } } } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java index 030287b5cf..41217d9971 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java @@ -137,11 +137,10 @@ class ReceivePackServlet extends HttpServlet { try { rp = receivePackFactory.create(req, getRepository(req)); } catch (ServiceNotAuthorizedException e) { - rsp.sendError(SC_UNAUTHORIZED); + rsp.sendError(SC_UNAUTHORIZED, e.getMessage()); return; - } catch (ServiceNotEnabledException e) { - sendError(req, rsp, SC_FORBIDDEN); + sendError(req, rsp, SC_FORBIDDEN, e.getMessage()); return; } diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java index 58404020cd..a021c1ff5e 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/RepositoryFilter.java @@ -137,10 +137,10 @@ public class RepositoryFilter implements Filter { sendError(req, res, SC_NOT_FOUND); return; } catch (ServiceNotEnabledException e) { - sendError(req, res, SC_FORBIDDEN); + sendError(req, res, SC_FORBIDDEN, e.getMessage()); return; } catch (ServiceNotAuthorizedException e) { - res.sendError(SC_UNAUTHORIZED); + res.sendError(SC_UNAUTHORIZED, e.getMessage()); return; } catch (ServiceMayNotContinueException e) { sendError(req, res, SC_FORBIDDEN, e.getMessage()); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java index 51332194b8..7d4f21b5c4 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java @@ -98,7 +98,7 @@ abstract class SmartServiceInfoRefs implements Filter { try { begin(req, db); } catch (ServiceNotAuthorizedException e) { - res.sendError(SC_UNAUTHORIZED); + res.sendError(SC_UNAUTHORIZED, e.getMessage()); return; } catch (ServiceNotEnabledException e) { sendError(req, res, SC_FORBIDDEN, e.getMessage()); @@ -132,11 +132,9 @@ abstract class SmartServiceInfoRefs implements Filter { advertise(req, new PacketLineOutRefAdvertiser(out)); buf.close(); } catch (ServiceNotAuthorizedException e) { - res.sendError(SC_UNAUTHORIZED); - + res.sendError(SC_UNAUTHORIZED, e.getMessage()); } catch (ServiceNotEnabledException e) { - sendError(req, res, SC_FORBIDDEN); - + sendError(req, res, SC_FORBIDDEN, e.getMessage()); } catch (ServiceMayNotContinueException e) { if (e.isOutput()) buf.close(); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java index 44d4b1bcfa..8c27b712ba 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java @@ -137,11 +137,10 @@ class UploadPackServlet extends HttpServlet { try { rp = uploadPackFactory.create(req, getRepository(req)); } catch (ServiceNotAuthorizedException e) { - rsp.sendError(SC_UNAUTHORIZED); + rsp.sendError(SC_UNAUTHORIZED, e.getMessage()); return; - } catch (ServiceNotEnabledException e) { - sendError(req, rsp, SC_FORBIDDEN); + sendError(req, rsp, SC_FORBIDDEN, e.getMessage()); return; } |