src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java
equal
deleted
inserted
replaced
35 import java.security.Permission; |
35 import java.security.Permission; |
36 import java.security.Principal; |
36 import java.security.Principal; |
37 import java.util.Map; |
37 import java.util.Map; |
38 import java.util.List; |
38 import java.util.List; |
39 import java.util.Optional; |
39 import java.util.Optional; |
|
40 import sun.net.util.IPAddressUtil; |
40 import sun.net.www.http.HttpClient; |
41 import sun.net.www.http.HttpClient; |
41 |
42 |
42 /** |
43 /** |
43 * A class to represent an HTTP connection to a remote object. |
44 * A class to represent an HTTP connection to a remote object. |
44 * |
45 * |
66 static URL checkURL(URL u) throws IOException { |
67 static URL checkURL(URL u) throws IOException { |
67 if (u != null) { |
68 if (u != null) { |
68 if (u.toExternalForm().indexOf('\n') > -1) { |
69 if (u.toExternalForm().indexOf('\n') > -1) { |
69 throw new MalformedURLException("Illegal character in URL"); |
70 throw new MalformedURLException("Illegal character in URL"); |
70 } |
71 } |
|
72 } |
|
73 String s = IPAddressUtil.checkAuthority(u); |
|
74 if (s != null) { |
|
75 throw new MalformedURLException(s); |
71 } |
76 } |
72 return u; |
77 return u; |
73 } |
78 } |
74 |
79 |
75 HttpsURLConnectionImpl(URL u, Proxy p, Handler handler) throws IOException { |
80 HttpsURLConnectionImpl(URL u, Proxy p, Handler handler) throws IOException { |
287 * existing values associated with the same key. |
292 * existing values associated with the same key. |
288 * |
293 * |
289 * @param key the keyword by which the request is known |
294 * @param key the keyword by which the request is known |
290 * (e.g., "<code>accept</code>"). |
295 * (e.g., "<code>accept</code>"). |
291 * @param value the value associated with it. |
296 * @param value the value associated with it. |
292 * @see #getRequestProperties(java.lang.String) |
297 * @see #getRequestProperty(java.lang.String) |
293 * @since 1.4 |
298 * @since 1.4 |
294 */ |
299 */ |
295 public void addRequestProperty(String key, String value) { |
300 public void addRequestProperty(String key, String value) { |
296 delegate.addRequestProperty(key, value); |
301 delegate.addRequestProperty(key, value); |
297 } |
302 } |