]> source.dussan.org Git - archiva.git/commitdiff
version is mandatory too
authorOlivier Lamy <olamy@apache.org>
Wed, 21 May 2014 05:19:52 +0000 (15:19 +1000)
committerOlivier Lamy <olamy@apache.org>
Wed, 21 May 2014 05:19:52 +0000 (15:19 +1000)
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java

index b923e37c73c754938e9b3a3ff35165e8f9c09ca8..62d0df2d3cfd527a5f988d7cb1fb7dff4c20edf9 100644 (file)
@@ -245,6 +245,30 @@ public class DefaultSearchService
                 } ).build();
             }
 
+            if ( StringUtils.isEmpty( version ) )
+            {
+                return Response.status( new Response.StatusType()
+                {
+                    @Override
+                    public int getStatusCode()
+                    {
+                        return Response.Status.BAD_REQUEST.getStatusCode();
+                    }
+
+                    @Override
+                    public Response.Status.Family getFamily()
+                    {
+                        return Response.Status.BAD_REQUEST.getFamily();
+                    }
+
+                    @Override
+                    public String getReasonPhrase()
+                    {
+                        return "version mandatory";
+                    }
+                } ).build();
+            }
+
             if ( StringUtils.isEmpty( artifactId ) )
             {
                 return Response.status( new Response.StatusType()