diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2012-09-19 19:19:20 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2012-09-19 19:19:20 -0700 |
commit | b3e8f29fe9f578e11ad322c94a4bd2dd6cfb6eb0 (patch) | |
tree | 7314f790b8fed8af44534de31ad88f531a620ed2 /org.eclipse.jgit.http.server | |
parent | f93a6a72290d475d080b1e76de58a21934422e90 (diff) | |
download | jgit-b3e8f29fe9f578e11ad322c94a4bd2dd6cfb6eb0.tar.gz jgit-b3e8f29fe9f578e11ad322c94a4bd2dd6cfb6eb0.zip |
Use '406 Not Acceptable' when info/refs is disabled
Instead of a confusing 403 Forbidden error indicating the dumb file
service is disabled on this server, use 406 Not Acceptable to mean
the client sent a request for content (the plain info/refs file)
that this server does not want to provide.
The stock C Git client will report HTTP 406 error if it predates
1.6.6 or something goes wrong with the smart request and it tried
falling back to the dumb request. This may help to debug cases where
a broken proxy server exists between the client and the server and
has mangled a prior smart info/refs response.
Change-Id: Ic2b78ba9502e4bbdff7cc3ba1fd284cf7616412b
Diffstat (limited to 'org.eclipse.jgit.http.server')
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java index 980d246d2d..529b8391fa 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java @@ -225,7 +225,7 @@ public class GitFilter extends MetaFilter { refs = refs.through(new AsIsFileFilter(asIs)); refs.with(new InfoRefsServlet()); } else - refs.with(new ErrorServlet(HttpServletResponse.SC_FORBIDDEN)); + refs.with(new ErrorServlet(HttpServletResponse.SC_NOT_ACCEPTABLE)); if (asIs != AsIsFileService.DISABLED) { final IsLocalFilter mustBeLocal = new IsLocalFilter(); |