Skip to content

Commit 27b86b9

Browse files
committed
don't set default proxy (no need)
1 parent f8d1bdc commit 27b86b9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ public void init() throws ServletException {
186186

187187
initTarget();//sets target*
188188

189-
// restricts this for some reason
190-
String allowRestrictedHeadersProp = "jdk.httpclient.allowRestrictedHeaders";
189+
// the JDK restricts this for some reason
190+
String allowRestrictedHeadersProp = "jdk.httpclient.allowRestrictedHeaders"; // comma delim
191191
if (System.getProperty(allowRestrictedHeadersProp) == null) {
192192
System.setProperty(allowRestrictedHeadersProp, "host");
193193
}
@@ -209,8 +209,6 @@ protected HttpClient.Builder buildClientBuilder() {
209209
builder.connectTimeout(Duration.ofMillis(connectTimeout));
210210
}
211211

212-
builder.proxy(ProxySelector.getDefault());
213-
214212
return builder;
215213
}
216214

@@ -411,8 +409,9 @@ private long getContentLength(HttpServletRequest request) {
411409
return -1L;
412410
}
413411

414-
/** These are the "hop-by-hop" headers that should not be copied.
415-
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
412+
/**
413+
* These are the "hop-by-hop" headers that should not be copied.
414+
* <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html">RFC-2616</a>
416415
*/
417416
protected static final Set<String> hopByHopHeaders = Set.of(
418417
"connection", "keep-alive", "proxy-authenticate", "proxy-authorization",
@@ -425,7 +424,6 @@ private long getContentLength(HttpServletRequest request) {
425424
*/
426425
protected void copyRequestHeaders(HttpServletRequest servletRequest, HttpRequest.Builder proxyRequest) {
427426
// Get an Enumeration of all of the header names sent by the client
428-
@SuppressWarnings("unchecked")
429427
Enumeration<String> enumerationOfHeaderNames = servletRequest.getHeaderNames();
430428
while (enumerationOfHeaderNames.hasMoreElements()) {
431429
String headerName = enumerationOfHeaderNames.nextElement();

0 commit comments

Comments
 (0)