Unidata / IDV

The Integrated Data Viewer (IDV) from Unidata is a framework for analyzing and displaying geoscience data.
http://www.unidata.ucar.edu/software/idv/
Other
80 stars 37 forks source link

HTTP to HTTPS #129

Open julienchastang opened 6 years ago

julienchastang commented 6 years ago

Related to #128. There are many references in the IDV that point to obsolete http URLs. Migrate to https. Document what needs to be updated in this issue.

lesserwhirls commented 6 years ago

If possible, it would be best to take the time to make sure whatever code is making the http requests checked the server response to see if there was a http redirect, and if so, checked the location returned in the server response to find the the new location of the resource.

jeffmcwhirter commented 6 years ago

Luckily most of not all of the url access in the IDV goes through a single method IOUtil.getInputStream so making this change shouldn’t be too hard

Jeff

On Mon, Nov 27, 2017 at 4:26 PM Sean Arms notifications@github.com wrote:

If possible, it would be best to take the time to make sure whatever code is making the http requests checked the server response to see if there was a http redirect, and if so, checked the location returned in the server response to find the the new location of the resource.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347363217, or mute the thread https://github.com/notifications/unsubscribe-auth/ABonTz8Oy4noqU-ZdssuSbF9Zvdb0GGrks5s60UXgaJpZM4QsZKK .

jon4than commented 6 years ago

Awhile back I basically did what Sean and Jeff proposed for McV, though we had to back out of the change for a few reasons (that escape me at the moment). Here's what I had:

https://github.com/Unidata/IDV/compare/master...jon4than:http-redirects?expand=1

I can create a pull request if you'd like.

yuanho commented 6 years ago

Jon,

Please create a pull request. Your solution is better.

Yuan

On Tue, Nov 28, 2017 at 5:40 PM, Jonathan Beavers notifications@github.com wrote:

Awhile back I basically did what Sean and Jeff proposed for McV, though we had to back out of the change for a few reasons (that escape me at the moment). Here's what I had:

https://github.com/Unidata/IDV/compare/master...jon4than: http-redirects?expand=1

I can create a pull request if you'd like.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347713317, or mute the thread https://github.com/notifications/unsubscribe-auth/ABI4rzhd5I7P_fc2LTSUJ6H4MM5HpIRgks5s7KgMgaJpZM4QsZKK .

jeffmcwhirter commented 6 years ago

I'm not sure who all did what but I made a change to IOUtil just now (so I could load some bundles for some drilsdown work) before I saw that its been changed. I'm checking my changes in and overriding the other changes as it seems like just swapping out http for https might not be an effective way to handle redirects as there might be server and/or path changes as well.

Below is the diff

-Jeff

                int response = huc.getResponseCode();
                //Check for redirect
                if (response == HttpURLConnection.HTTP_MOVED_TEMP
                    || response == HttpURLConnection.HTTP_MOVED_PERM
                    || response == HttpURLConnection.HTTP_SEE_OTHER) {
                    String newUrl =

connection.getHeaderField("Location"); connection = new URL(newUrl).openConnection(); connection.setAllowUserInteraction(true); huc = (HttpURLConnection) connection; }

1297,1301d1306 < } else if (huc.getResponseCode() == 301 || huc.getResponseCode() == 302) { < String urlStr = url.toString().replaceFirst("http:", "https:"); < URL newURL = new URL(urlStr); < connection = newURL.openConnection(); < connection.setReadTimeout(30000); //30 sec

On Tue, Nov 28, 2017 at 8:06 PM, yuanho notifications@github.com wrote:

Jon,

Please create a pull request. Your solution is better.

Yuan

On Tue, Nov 28, 2017 at 5:40 PM, Jonathan Beavers < notifications@github.com> wrote:

Awhile back I basically did what Sean and Jeff proposed for McV, though we had to back out of the change for a few reasons (that escape me at the moment). Here's what I had:

https://github.com/Unidata/IDV/compare/master...jon4than: http-redirects?expand=1

I can create a pull request if you'd like.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347713317, or mute the thread https://github.com/notifications/unsubscribe-auth/ABI4rzhd5I7P_ fc2LTSUJ6H4MM5HpIRgks5s7KgMgaJpZM4QsZKK .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347738731, or mute the thread https://github.com/notifications/unsubscribe-auth/ABonT7n7txxXnYBEpPRqRePR0G6-M42Qks5s7ModgaJpZM4QsZKK .