diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2016-12-06 16:55:16 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2016-12-06 16:55:28 +0900 |
commit | c62933bf5946663e47c29d3713d1fca989f304bc (patch) | |
tree | d63090a10835284c1dfd18629ed1720f3a0bcb1c /org.eclipse.jgit.lfs.server/src/org/eclipse/jgit | |
parent | 196a773e23c1674983229120cfddb1cc6f8a78d1 (diff) | |
parent | 8f6029786144b1d96e48d789c187cd8138ce8256 (diff) | |
download | jgit-c62933bf5946663e47c29d3713d1fca989f304bc.tar.gz jgit-c62933bf5946663e47c29d3713d1fca989f304bc.zip |
Merge branch 'stable-4.5'
* stable-4.5:
Use the same variable to check and extract LFS object id
Change-Id: I314bd4373f40843c68853b3999f60d85e08628d9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java index f39a680c7f..a6079671de 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java @@ -128,13 +128,14 @@ public class FileLfsServlet extends HttpServlet { private AnyLongObjectId getObjectToTransfer(HttpServletRequest req, HttpServletResponse rsp) throws IOException { String info = req.getPathInfo(); - if (info.length() != 1 + Constants.LONG_OBJECT_ID_STRING_LENGTH) { + int length = 1 + Constants.LONG_OBJECT_ID_STRING_LENGTH; + if (info.length() != length) { sendError(rsp, HttpStatus.SC_UNPROCESSABLE_ENTITY, MessageFormat .format(LfsServerText.get().invalidPathInfo, info)); return null; } try { - return LongObjectId.fromString(info.substring(1, 65)); + return LongObjectId.fromString(info.substring(1, length)); } catch (InvalidLongObjectIdException e) { sendError(rsp, HttpStatus.SC_UNPROCESSABLE_ENTITY, e.getMessage()); return null; |