urlrewritefilter icon indicating copy to clipboard operation
urlrewritefilter copied to clipboard

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

Open GoogleCodeExporter opened this issue 10 years ago • 3 comments

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 [email protected] on 9 Dec 2013 at 11:14

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter

I completely agree.

Original comment by [email protected] on 8 Dec 2014 at 5:15

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter

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 [email protected] on 10 Mar 2015 at 12:50

GoogleCodeExporter avatar Jul 05 '15 22:07 GoogleCodeExporter

It's been over 3 years, can you cut a release of this project with this fix included please? 4.0.5 would be great. I'm on 4.0.4 and it is not included.

jessefarinacci avatar Sep 11 '18 00:09 jessefarinacci