I am creating a proxy server and I need to send a custom header in the request object while poxying request to upstream server. I used Java header filter and tried request.put("test","value") but it was not printed in the list of headers when I printed on upstream server. Can someone guide on how it can be done?
public class NginxTestHandler implements NginxJavaHeaderFilter {
private static final String COOKIE_NAME = "WORK";
@Override
public Object[] doFilter(int status, Map<String, Object> request, Map<String, Object> responseHeaders) {
ArrayMap<String, Object> responseHeadersMap = new ArrayMap<String, Object>();
System.err.println("before test hand");
responseHeaders.remove("Content-Type");
responseHeaders.put("Content-Type", "text/html");
responseHeaders.put("Xfeep-Header", "Hello2!");
responseHeaders.put("Server", "My-Test-Server");
NginxUtils.setCookies(responseHeadersMap, COOKIE_NAME, "help");
responseHeaders.putAll(responseHeadersMap);
request.put("GUID", "A1234567");
return Constants.PHASE_DONE;
}
}
--
You received this message because you are subscribed to the Google Groups "Nginx-Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginx-clojure+unsubscribe@googlegroups.com.
To post to this group, send email to nginx-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nginx-clojure/67efd05e-af54-47bd-8679-549fb2b662b7%40googlegroups.com.