summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaria Odea B. Ching <oching@apache.org>2008-05-22 10:18:03 +0000
committerMaria Odea B. Ching <oching@apache.org>2008-05-22 10:18:03 +0000
commite68187283844d45f9985649b73015e7608a6a75c (patch)
tree71eb6fc569bae024a52a9f35bd31d484776a549d
parentac7cb9e9ce33fbbbf4a01ac5a4da3b6e1b0111ef (diff)
downloadarchiva-e68187283844d45f9985649b73015e7608a6a75c.tar.gz
archiva-e68187283844d45f9985649b73015e7608a6a75c.zip
[MRM-694]
-return 405 instead of 400 for write request to repo groups git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@659071 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java6
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java
index 201ac9342..72684fd01 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletRepositoryGroupTest.java
@@ -205,7 +205,7 @@ public class RepositoryServletRepositoryGroupTest
WebRequest request = new PutMethodWebRequest( putUrl, is, "text/plain" );
WebResponse response = sc.getResponse( request );
- assertResponseBadRequest( response );
+ assertResponseMethodNotAllowed( response );
}
public void testBrowseRepositoryGroup()
@@ -218,10 +218,10 @@ public class RepositoryServletRepositoryGroupTest
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 )
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
index 3b4d0b27d..c51f883aa 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
@@ -142,8 +142,8 @@ public class ArchivaDavResourceFactory
{
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() );