mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Use 422 status when rejecting Git LFS request
This commit is contained in:
@@ -37,7 +37,7 @@ public class GitLfsHandler extends AbstractHandler {
|
||||
) {
|
||||
Log.info(method + " <- /<project>.git/info/lfs/objects/batch");
|
||||
response.setContentType("application/vnd.git-lfs+json");
|
||||
response.setStatus(406);
|
||||
response.setStatus(422);
|
||||
response.getWriter().println("{\"message\": \"ERROR: Git LFS is not supported on Overleaf\"}");
|
||||
baseRequest.setHandled(true);
|
||||
}
|
||||
|
||||
+1
-1
@@ -989,7 +989,7 @@ public class WLGitBridgeIntegrationTest {
|
||||
String urlBase = "http://127.0.0.1:" + gitBridgePort;
|
||||
HttpPost gitLfsRequest = new HttpPost(urlBase+"/5f2419407929eb0026641967.git/info/lfs/objects/batch");
|
||||
HttpResponse gitLfsResponse = client.execute(gitLfsRequest);
|
||||
assertEquals(406, gitLfsResponse.getStatusLine().getStatusCode());
|
||||
assertEquals(422, gitLfsResponse.getStatusLine().getStatusCode());
|
||||
HttpEntity entity = gitLfsResponse.getEntity();
|
||||
String responseString = EntityUtils.toString(entity, "UTF-8");
|
||||
assertTrue(responseString.contains("Git LFS is not supported on Overleaf"));
|
||||
|
||||
Reference in New Issue
Block a user