Commit 3e98c78c by Spencer Gibb

add PATCH to SimpleHostRoutingFilter

fixes gh-307
parent 6dce075e
...@@ -43,11 +43,13 @@ import javax.servlet.http.HttpServletRequest; ...@@ -43,11 +43,13 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
import org.apache.http.HttpRequest; import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient; import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPatch;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.params.ClientPNames; import org.apache.http.client.params.ClientPNames;
...@@ -206,6 +208,12 @@ public class SimpleHostRoutingFilter extends ZuulFilter { ...@@ -206,6 +208,12 @@ public class SimpleHostRoutingFilter extends ZuulFilter {
httpPut.setEntity(new InputStreamEntity(requestEntity, request httpPut.setEntity(new InputStreamEntity(requestEntity, request
.getContentLength())); .getContentLength()));
break; break;
case "PATCH":
HttpPatch httpPatch = new HttpPatch(uri + getQueryString());
httpRequest = httpPatch;
httpPatch.setEntity(new InputStreamEntity(requestEntity, request
.getContentLength()));
break;
default: default:
httpRequest = new BasicHttpRequest(verb, uri + getQueryString()); httpRequest = new BasicHttpRequest(verb, uri + getQueryString());
log.debug(uri + getQueryString()); log.debug(uri + getQueryString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment