jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
changeset 37781 71ed5645f17c
parent 37593 824750ada3d6
child 40737 9b5eee5d7a26
equal deleted inserted replaced
37780:06f3783b338f 37781:71ed5645f17c
   205         //"User-Agent",
   205         //"User-Agent",
   206         "Via"
   206         "Via"
   207     };
   207     };
   208 
   208 
   209     static {
   209     static {
   210         Properties props = GetPropertyAction.getProperties();
   210         Properties props = GetPropertyAction.privilegedGetProperties();
   211         maxRedirects = GetIntegerAction.getProperty("http.maxRedirects",
   211         maxRedirects = GetIntegerAction.privilegedGetProperty(
   212                         defaultmaxRedirects);
   212                 "http.maxRedirects", defaultmaxRedirects);
   213         version = props.getProperty("java.version");
   213         version = props.getProperty("java.version");
   214         String agent = props.getProperty("http.agent");
   214         String agent = props.getProperty("http.agent");
   215         if (agent == null) {
   215         if (agent == null) {
   216             agent = "Java/"+version;
   216             agent = "Java/"+version;
   217         } else {
   217         } else {
   223         validateServer = Boolean.parseBoolean(
   223         validateServer = Boolean.parseBoolean(
   224                 props.getProperty("http.auth.digest.validateServer"));
   224                 props.getProperty("http.auth.digest.validateServer"));
   225 
   225 
   226         enableESBuffer = Boolean.parseBoolean(
   226         enableESBuffer = Boolean.parseBoolean(
   227                 props.getProperty("sun.net.http.errorstream.enableBuffering"));
   227                 props.getProperty("sun.net.http.errorstream.enableBuffering"));
   228         timeout4ESBuffer = GetIntegerAction
   228         timeout4ESBuffer = GetIntegerAction.privilegedGetProperty(
   229                 .getProperty("sun.net.http.errorstream.timeout", 300);
   229                 "sun.net.http.errorstream.timeout", 300);
   230         if (timeout4ESBuffer <= 0) {
   230         if (timeout4ESBuffer <= 0) {
   231             timeout4ESBuffer = 300; // use the default
   231             timeout4ESBuffer = 300; // use the default
   232         }
   232         }
   233 
   233 
   234         bufSize4ES = GetIntegerAction
   234         bufSize4ES = GetIntegerAction.privilegedGetProperty(
   235                 .getProperty("sun.net.http.errorstream.bufferSize", 4096);
   235                 "sun.net.http.errorstream.bufferSize", 4096);
   236         if (bufSize4ES <= 0) {
   236         if (bufSize4ES <= 0) {
   237             bufSize4ES = 4096; // use the default
   237             bufSize4ES = 4096; // use the default
   238         }
   238         }
   239 
   239 
   240         allowRestrictedHeaders = Boolean.parseBoolean(
   240         allowRestrictedHeaders = Boolean.parseBoolean(