mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
deal with createInputRaw() casting issue (#3514)
This commit is contained in:
@@ -6664,18 +6664,21 @@ public class PApplet implements PConstants {
|
||||
try {
|
||||
URL url = new URL(filename);
|
||||
URLConnection conn = url.openConnection();
|
||||
HttpURLConnection httpConn = (HttpURLConnection) conn;
|
||||
// Will not handle a protocol change (see below)
|
||||
httpConn.setInstanceFollowRedirects(true);
|
||||
int response = httpConn.getResponseCode();
|
||||
// Normally will not follow HTTPS redirects from HTTP due to security concerns
|
||||
// http://stackoverflow.com/questions/1884230/java-doesnt-follow-redirect-in-urlconnection/1884427
|
||||
if (response >= 300 && response < 400) {
|
||||
String newLocation = httpConn.getHeaderField("Location");
|
||||
return createInputRaw(newLocation);
|
||||
if (conn instanceof HttpURLConnection) {
|
||||
HttpURLConnection httpConn = (HttpURLConnection) conn;
|
||||
// Will not handle a protocol change (see below)
|
||||
httpConn.setInstanceFollowRedirects(true);
|
||||
int response = httpConn.getResponseCode();
|
||||
// Normally will not follow HTTPS redirects from HTTP due to security concerns
|
||||
// http://stackoverflow.com/questions/1884230/java-doesnt-follow-redirect-in-urlconnection/1884427
|
||||
if (response >= 300 && response < 400) {
|
||||
String newLocation = httpConn.getHeaderField("Location");
|
||||
return createInputRaw(newLocation);
|
||||
}
|
||||
return conn.getInputStream();
|
||||
} else if (conn instanceof JarURLConnection) {
|
||||
return url.openStream();
|
||||
}
|
||||
return conn.getInputStream();
|
||||
|
||||
} catch (MalformedURLException mfue) {
|
||||
// not a url, that's fine
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ X tweak implementation of PVector.heading()
|
||||
X https://github.com/processing/processing/issues/3511
|
||||
X make PFont.size protected again
|
||||
X https://github.com/processing/processing/issues/3519
|
||||
X fix problem with JAR loading inside createInputRaw()
|
||||
o https://github.com/processing/processing/pull/3514
|
||||
|
||||
|
||||
opengl
|
||||
|
||||
@@ -5,6 +5,9 @@ X Add message that says it's safe to ignore the tools.jar warning
|
||||
X add new lower console/errors icons
|
||||
_ don't show display warning when display 1 doesn't exist
|
||||
|
||||
_ can't install processing-java into /usr/bin with El Capitan
|
||||
_ https://github.com/processing/processing/issues/3497
|
||||
|
||||
fixed earlier
|
||||
X font fixes for Georgia in the examples
|
||||
X contribs listed multiple times
|
||||
@@ -21,7 +24,7 @@ X https://github.com/processing/processing/issues/3481
|
||||
X https://github.com/processing/processing/pull/3489
|
||||
X include mode imports when rewriting .properties file
|
||||
X https://github.com/processing/processing/pull/3499
|
||||
_ https://github.com/processing/processing/issues/3492
|
||||
X https://github.com/processing/processing/issues/3492
|
||||
|
||||
|
||||
beta
|
||||
|
||||
Reference in New Issue
Block a user