[OLINGO-482] non-standard HTTP MERGE not to be used in server part

Change-Id: I425dd5b79617ca7f1a56818d0bb106611792ebd5

Signed-off-by: Christian Amend <chrisam@apache.org>
This commit is contained in:
Klaus Straubinger 2014-11-07 08:53:00 +01:00 committed by Christian Amend
parent a405e5b4b5
commit 300250af3c
4 changed files with 3 additions and 12 deletions

View File

@ -84,7 +84,6 @@ public class UriValidator {
/* PUT 0 */ { false , false , false , false, false , false , false , false , false , false , false , false }, /* PUT 0 */ { false , false , false , false, false , false , false , false , false , false , false , false },
/* DELETE 0 */ { false , false , false , false, false , false, false , false, false , false , false, false }, /* DELETE 0 */ { false , false , false , false, false , false, false , false, false , false , false, false },
/* PATCH 0 */ { false , false , false , false, false , false , false , false , false , false , false , false }, /* PATCH 0 */ { false , false , false , false, false , false , false , false , false , false , false , false },
/* MERGE 0 */ { false , false , false , false, false , false , false , false , false , false , false , false },
}; };
//CHECKSTYLE:ON //CHECKSTYLE:ON
@ -154,8 +153,7 @@ public class UriValidator {
POST(1), POST(1),
PUT(2), PUT(2),
DELETE(3), DELETE(3),
MERGE(4), PATCH(4);
PATCH(5);
private int idx; private int idx;
@ -602,9 +600,6 @@ public class UriValidator {
case PATCH: case PATCH:
idx = RowIndexForHttpMethod.PATCH; idx = RowIndexForHttpMethod.PATCH;
break; break;
case MERGE:
idx = RowIndexForHttpMethod.MERGE;
break;
default: default:
throw new UriValidationException("HTTP method not supported: " + httpMethod, throw new UriValidationException("HTTP method not supported: " + httpMethod,
UriValidationException.MessageKeys.UNSUPPORTED_HTTP_METHOD, httpMethod.toString()); UriValidationException.MessageKeys.UNSUPPORTED_HTTP_METHOD, httpMethod.toString());

View File

@ -38,7 +38,6 @@ public class ODataHttpHandlerImplTest {
{ "GET", null, null, "GET" }, { "GET", null, null, "GET" },
{ "GET", "xxx", "yyy", "GET" }, { "GET", "xxx", "yyy", "GET" },
{ "PUT", "xxx", "yyy", "PUT" }, { "PUT", "xxx", "yyy", "PUT" },
{ "MERGE", "xxx", "yyy", "MERGE" },
{ "DELETE", "xxx", "yyy", "DELETE" }, { "DELETE", "xxx", "yyy", "DELETE" },
{ "PATCH", "xxx", "yyy", "PATCH" }, { "PATCH", "xxx", "yyy", "PATCH" },
@ -47,7 +46,7 @@ public class ODataHttpHandlerImplTest {
{ "POST", null, "PATCH", "PATCH" }, { "POST", null, "PATCH", "PATCH" },
{ "POST", "GET", null, "GET" }, { "POST", "GET", null, "GET" },
{ "POST", "MERGE", null, "MERGE" }, { "POST", "PATCH", null, "PATCH" },
{ "POST", "GET", "GET", "GET" }, { "POST", "GET", "GET", "GET" },
}; };
@ -71,7 +70,7 @@ public class ODataHttpHandlerImplTest {
public void extractMethodFail() throws Exception { public void extractMethodFail() throws Exception {
String[][] mm = { String[][] mm = {
{ "POST", "bla", null }, { "POST", "bla", null },
{ "POST", "MERGE", "PATCH" }, { "POST", "PUT", "PATCH" },
{ "OPTIONS", null, null }, { "OPTIONS", null, null },
{ "HEAD", null, null }, { "HEAD", null, null },
}; };

View File

@ -77,7 +77,6 @@ public class ODataHandlerTest {
dispatchMethodNotAllowed(HttpMethod.POST, "/", processor); dispatchMethodNotAllowed(HttpMethod.POST, "/", processor);
dispatchMethodNotAllowed(HttpMethod.PUT, "/", processor); dispatchMethodNotAllowed(HttpMethod.PUT, "/", processor);
dispatchMethodNotAllowed(HttpMethod.PATCH, "/", processor); dispatchMethodNotAllowed(HttpMethod.PATCH, "/", processor);
dispatchMethodNotAllowed(HttpMethod.MERGE, "/", processor);
dispatchMethodNotAllowed(HttpMethod.DELETE, "/", processor); dispatchMethodNotAllowed(HttpMethod.DELETE, "/", processor);
} }
@ -116,7 +115,6 @@ public class ODataHandlerTest {
dispatchMethodNotAllowed(HttpMethod.POST, "$metadata", processor); dispatchMethodNotAllowed(HttpMethod.POST, "$metadata", processor);
dispatchMethodNotAllowed(HttpMethod.PUT, "$metadata", processor); dispatchMethodNotAllowed(HttpMethod.PUT, "$metadata", processor);
dispatchMethodNotAllowed(HttpMethod.PATCH, "$metadata", processor); dispatchMethodNotAllowed(HttpMethod.PATCH, "$metadata", processor);
dispatchMethodNotAllowed(HttpMethod.MERGE, "$metadata", processor);
dispatchMethodNotAllowed(HttpMethod.DELETE, "$metadata", processor); dispatchMethodNotAllowed(HttpMethod.DELETE, "$metadata", processor);
} }

View File

@ -266,7 +266,6 @@ public class UriValidatorTest {
validator.validate(uri, HttpMethod.PUT); validator.validate(uri, HttpMethod.PUT);
validator.validate(uri, HttpMethod.DELETE); validator.validate(uri, HttpMethod.DELETE);
validator.validate(uri, HttpMethod.PATCH); validator.validate(uri, HttpMethod.PATCH);
validator.validate(uri, HttpMethod.MERGE);
} }
@Test @Test