summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server/resources/org/eclipse/jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-11-22 15:51:11 -0800
committerShawn O. Pearce <spearce@spearce.org>2011-11-22 15:51:14 -0800
commit867087bb1119aa0ed52c01095c121229929c007e (patch)
treee492a1bd7ca54fa6da4a561655970cffda41676a /org.eclipse.jgit.http.server/resources/org/eclipse/jgit
parent9d311b333347d13ff2f9e0b7109e6b164a3643cc (diff)
downloadjgit-867087bb1119aa0ed52c01095c121229929c007e.tar.gz
jgit-867087bb1119aa0ed52c01095c121229929c007e.zip
Add utilities for smart HTTP error handling
The GitSmartHttpTools class started as utility functions to help report useful error messages to users of the android.googlesource.com service. Now that the GitServlet and GitFilter classes support filters before a git-upload-pack or git-receive-pack request, server implementors may these routines helpful to report custom messages to clients. Using the sendError() method to return an HTTP 200 OK with error text embedded in the payload prevents native Git clients from retrying the action with a dumb Git or WebDAV HTTP request. Refactor some of the existing code to use these new error functions and protocol constants. The new sendError() function is very close to being identical to the old error handling code in RepositoryFilter, however we now use the POST Content-Type rather than the Accept HTTP header to check if the client will accept the error data in the response body rather than using the HTTP status code. This is a more reliable way of checking for native Git clients, as the Accept header was not always populated with the correct string in older versions of Git smart HTTP. Change-Id: I828ac2deb085af12b6689c10f86662ddd39bd1a2
Diffstat (limited to 'org.eclipse.jgit.http.server/resources/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.http.server/resources/org/eclipse/jgit/http/server/HttpServerText.properties1
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.jgit.http.server/resources/org/eclipse/jgit/http/server/HttpServerText.properties b/org.eclipse.jgit.http.server/resources/org/eclipse/jgit/http/server/HttpServerText.properties
index a7643c5f9e..e811891904 100644
--- a/org.eclipse.jgit.http.server/resources/org/eclipse/jgit/http/server/HttpServerText.properties
+++ b/org.eclipse.jgit.http.server/resources/org/eclipse/jgit/http/server/HttpServerText.properties
@@ -3,6 +3,7 @@ cannotGetLengthOf=Cannot get length of {0}
encodingNotSupportedByThisLibrary={0} "{1}": not supported by this library.
expectedRepositoryAttribute=Expected Repository attribute
filterMustNotBeNull=filter must not be null
+internalServerError=Internal server error
internalErrorDuringReceivePack=Internal error during receive-pack
internalErrorDuringUploadPack=Internal error during upload-pack
internalServerErrorRequestAttributeWasAlreadySet=Internal server error, request attribute {0} was already set when {1} was invoked.