tjg184 / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

Add Support for 'PUT' and 'DELETE' HttpMethod in RequestProxy #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Issue PUT or DELETE through Request Proxy
2.
3.

What is the expected output? What do you see instead?
Requests get proxied through.  They get blocked.

What version of the product are you using? On what operating system?
4.0.3

Please provide any additional information below.
Applied the following changes to RequestProxy.java and PUT and DELETE request 
now proxy through correctly.

if ("POST".equalsIgnoreCase(methodName)) {
    PostMethod postMethod = new PostMethod();
    InputStreamRequestEntity inputStreamRequestEntity = new InputStreamRequestEntity(hsRequest.getInputStream());
    postMethod.setRequestEntity(inputStreamRequestEntity);
    method = postMethod;
} else if ("PUT".equalsIgnoreCase(methodName)) {
    PutMethod putMethod = new PutMethod();
    InputStreamRequestEntity inputStreamRequestEntity = new InputStreamRequestEntity(hsRequest.getInputStream());
    putMethod.setRequestEntity(inputStreamRequestEntity);
    method = putMethod;
} else if ("DELETE".equalsIgnoreCase(methodName)) {
    method = new DeleteMethod();
} else if ("GET".equalsIgnoreCase(methodName)) {
    method = new GetMethod();
} else {
    log.warn("Unsupported HTTP method requested: " + hsRequest.getMethod());
    return null;
}

Original issue reported on code.google.com by QuinnT...@gmail.com on 9 Dec 2013 at 11:14

GoogleCodeExporter commented 9 years ago
I completely agree.

Original comment by alberto....@gmail.com on 8 Dec 2014 at 5:15

GoogleCodeExporter commented 9 years ago
I also just stumbled over the missing support for PUT and DELETE and agree with 
the reporter that the given patch should work.

Original comment by fleque.c...@gmail.com on 10 Mar 2015 at 12:50