diff --git a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java index 6c4f3cbb9..ac707eacf 100644 --- a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java +++ b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java @@ -78,7 +78,7 @@ public void testDownloadInvalidPathInfo() getContent(id.name().substring(0, 60), f); fail("expected RuntimeException"); } catch (RuntimeException e) { - assertEquals("Status: 400 Bad Request", + assertEquals("Status: 422 Unprocessable Entity", e.getMessage()); } } @@ -93,7 +93,7 @@ public void testDownloadInvalidId() getContent(id.name().replace('f', 'z'), f); fail("expected RuntimeException"); } catch (RuntimeException e) { - assertEquals("Status: 400 Bad Request", + assertEquals("Status: 422 Unprocessable Entity", e.getMessage()); } } 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 586941357..925dea8de 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 @@ -121,14 +121,14 @@ private AnyLongObjectId getObjectToTransfer(HttpServletRequest req, HttpServletResponse rsp) throws IOException { String info = req.getPathInfo(); if (info.length() != 1 + Constants.LONG_OBJECT_ID_STRING_LENGTH) { - sendError(rsp, HttpStatus.SC_BAD_REQUEST, MessageFormat + sendError(rsp, HttpStatus.SC_UNPROCESSABLE_ENTITY, MessageFormat .format(LfsServerText.get().invalidPathInfo, info)); return null; } try { return LongObjectId.fromString(info.substring(1, 65)); } catch (InvalidLongObjectIdException e) { - sendError(rsp, HttpStatus.SC_BAD_REQUEST, e.getMessage()); + sendError(rsp, HttpStatus.SC_UNPROCESSABLE_ENTITY, e.getMessage()); return null; } }