提交 11b89cb0 编写于 作者: M michaelm

6952017: HttpURLConnection chunked encoding issue (Http request splitting)

Reviewed-by: chegar
上级 338d57c7
......@@ -463,9 +463,12 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
"application/x-www-form-urlencoded");
}
boolean chunked = false;
if (streaming()) {
if (chunkLength != -1) {
requests.set ("Transfer-Encoding", "chunked");
chunked = true;
} else { /* fixed content length */
if (fixedContentLengthLong != -1) {
requests.set ("Content-Length",
......@@ -485,6 +488,16 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
}
}
if (!chunked) {
if (requests.findValue("Transfer-Encoding") != null) {
requests.remove("Transfer-Encoding");
if (logger.isLoggable(PlatformLogger.WARNING)) {
logger.warning(
"use streaming mode for chunked encoding");
}
}
}
// get applicable cookies based on the uri and request headers
// add them to the existing request headers
setCookieHeader();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册