Modify

Opened 7 years ago

Closed 7 years ago

#8886 closed defect (fixed)

Internal download of plugin does not work

Reported by: skyper Owned by: Don-vip
Priority: normal Milestone:
Component: Core Version:
Keywords: plugin download http https redirect github Cc:

Description

Just to have it reported.

The internal download does not work as redirects are not supported.

Tested with both plugin versions and latest + tested.

You have to manually download and install the plugin.

org.openstreetmap.josm.plugins.PluginDownloadException: java.io.IOException: Server returned HTTP response code: 502 for URL: https://github.com/iandees/josm-fieldpapers/releases/download/0.2/fieldpapers.jar
	at org.openstreetmap.josm.plugins.PluginDownloadTask.download(PluginDownloadTask.java:138)
	at org.openstreetmap.josm.plugins.PluginDownloadTask.realRun(PluginDownloadTask.java:164)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: Server returned HTTP response code: 502 for URL: https://github.com/iandees/josm-fieldpapers/releases/download/0.2/fieldpapers.jar
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1403)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
	at org.openstreetmap.josm.plugins.PluginDownloadTask.download(PluginDownloadTask.java:125)
	... 9 more

Attachments (0)

Change History (7)

comment:1 Changed 7 years ago by iandees

JOSM needs to follow redirects for the Github "releases" feature to work. Is there a reason why it doesn't or would you accept a patch to follow a redirect?

comment:2 Changed 7 years ago by stoecker

Other plugins are also downloaded from GitHub. You can supply a patch, but is it needed?

Last edited 7 years ago by stoecker (previous) (diff)

comment:3 Changed 7 years ago by iandees

The other plugins are either storing the binary in Git (which is frowned upon) or are using the deprecated Github Downloads feature. This Releases thing replaces that downloads feature.

comment:4 Changed 7 years ago by Don-vip

I agree we should support this. But I don't understand why there's a 502 error ? That's not the standard http redirect ?

comment:5 Changed 7 years ago by iandees

Not sure what's going on with the 502. When I curl it I get a 302 with a proper Location header that points to a temporary S3 URL for the real download:

< HTTP/1.1 302 Found
< Server: GitHub.com
< Date: Thu, 18 Jul 2013 14:48:00 GMT
< Content-Type: text/html; charset=utf-8
< Connection: keep-alive
< Status: 302 Found
< Cache-Control: no-cache
< Strict-Transport-Security: max-age=2592000
< X-Frame-Options: deny
< Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Mon, 18-Jul-2033 14:48:00 GMT; secure; HttpOnly
< Set-Cookie: dotcom_user=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
< Location: http://s3.amazonaws.com/github-cloud/releases/11440635/c77c610c-eedf-11e2-98f5-b60da7f02dbf.jar?response-content-disposition=attachment%3B%20filename%3Dfieldpapers.jar&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1374158940&Signature=yCWNJxF3K6q7j9rJC7BvyDhboTE%3D
< X-Runtime: 26
< Content-Length: 341
< Vary: Accept-Encoding
<
* Connection #0 to host github.com left intact
<html><body>You are being <a href="http://s3.amazonaws.com/github-cloud/releases/11440635/c77c610c-eedf-11e2-98f5-b60da7f02dbf.jar?response-content-disposition=attachment%3B%20filename%3Dfieldpapers.jar&amp;AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&amp;Expires=1374158940&amp;Signature=yCWNJxF3K6q7j9rJC7BvyDhboTE%3D">redirected</a>.</body></html>

comment:6 Changed 7 years ago by Don-vip

Component: Plugin fieldpapersCore
Keywords: plugin http https redirect github added; internal removed
Owner: changed from iandees to Don-vip
Status: newassigned

comment:7 Changed 7 years ago by Don-vip

Resolution: fixed
Status: assignedclosed

In 6073/josm:

fix #8886 - Allow to download plugin jars redirected from https to http, like those hosted on github

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.