W3C home > Mailing lists > Public > www-validator-cvs@w3.org > March 2010

2006/unicorn/src/org/w3c/unicorn/input URIInputParameter.java,1.16,1.17

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 23 Mar 2010 11:24:26 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Nu2Di-00070o-V8@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/input
In directory hutz:/tmp/cvs-serv26940/src/org/w3c/unicorn/input

Modified Files:
	URIInputParameter.java 
Log Message:
Fixed check() function: threw a ClassCastException on non-https protocol documents

Index: URIInputParameter.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/input/URIInputParameter.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- URIInputParameter.java	21 Mar 2010 22:52:50 -0000	1.16
+++ URIInputParameter.java	23 Mar 2010 11:24:24 -0000	1.17
@@ -76,12 +76,12 @@
 			if (!docUrl.getProtocol().equals("http") && !docUrl.getProtocol().equals("https"))
 				throw new UnicornException(Message.ERROR, "$message_unsupported_protocol", null, docUrl.getProtocol());
 			
-			HttpsURLConnection con = (HttpsURLConnection) docUrl.openConnection();
+			HttpURLConnection con = (HttpURLConnection) docUrl.openConnection();
 			con.setConnectTimeout(connectTimeOut);
 			try {
 				con.connect();
 			} catch (SSLException e) {
-				con.setSSLSocketFactory(sc.getSocketFactory());
+				((HttpsURLConnection) con).setSSLSocketFactory(sc.getSocketFactory());
 				con.connect();
 				Message message = new Message(Message.WARNING, "$message_ssl_warning", e.getClass() + "\n" + e.getMessage());
 				message.setEvaluateContent(false);
Received on Tuesday, 23 March 2010 11:24:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:19 GMT