urlrewritefilter
urlrewritefilter copied to clipboard
Add Support for 'PUT' and 'DELETE' HttpMethod in RequestProxy
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
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
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.