archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r659071 - in /archiva/trunk/archiva-modules/archiva-web: archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/ archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/
Date Thu, 22 May 2008 10:18:04 GMT
Author: oching
Date: Thu May 22 03:18:03 2008
New Revision: 659071

URL: http://svn.apache.org/viewvc?rev=659071&view=rev
Log:
[MRM-694]
-return 405 instead of 400 for write request to repo groups

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java?rev=659071&r1=659070&r2=659071&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java
Thu May 22 03:18:03 2008
@@ -205,7 +205,7 @@
         WebRequest request = new PutMethodWebRequest( putUrl, is, "text/plain" );
         WebResponse response = sc.getResponse( request );
          
-        assertResponseBadRequest( response );
+        assertResponseMethodNotAllowed( response );
     }
     
     public void testBrowseRepositoryGroup()
@@ -218,10 +218,10 @@
         assertEquals( "Should have been an 401 response code.", HttpServletResponse.SC_UNAUTHORIZED,
response.getResponseCode() );
     }
         
-    protected void assertResponseBadRequest( WebResponse response )
+    protected void assertResponseMethodNotAllowed( WebResponse response )
     {
         assertNotNull( "Should have recieved a response", response );
-        assertEquals( "Should have been an 400/Bad Request response code.", HttpServletResponse.SC_BAD_REQUEST,
response.getResponseCode() );
+        assertEquals( "Should have been an 405/Method Not Allowed response code.", HttpServletResponse.SC_METHOD_NOT_ALLOWED,
response.getResponseCode() );
     }
 
     protected RepositoryGroupConfiguration createRepositoryGroup( String id, List<String>
repositories )

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java?rev=659071&r1=659070&r2=659071&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
Thu May 22 03:18:03 2008
@@ -142,8 +142,8 @@
         {   
             if( WebdavMethodUtil.isWriteMethod( request.getMethod() ) )
             {
-                throw new DavException( HttpServletResponse.SC_BAD_REQUEST, "Bad request
to repository group <" +
-                    repoGroupConfig.getId() + ">" );
+                throw new DavException( HttpServletResponse.SC_METHOD_NOT_ALLOWED,
+                                        "Write method not allowed for repository groups."
);
             }
             repositories.addAll( repoGroupConfig.getRepositories() );
             



Mime
View raw message