wbond / package_control

The Sublime Text package manager
https://packagecontrol.io
4.79k stars 814 forks source link

Handle Redirects #1502

Closed wbond closed 9 months ago

wbond commented 3 years ago

All downloaders should handle HTTP codes 301, 302, 303 and 307.

deathaxe commented 1 year ago

It appears package_control's downloaders handle redirects well already.

Tested on ST 3143 and 4147 on Windows, running PC on python 3.3 as well as on 3.8

All of the following expressions, executed via ST's console handle 302 and download the requested file as expected. A detailed log to proove that can be found at https://github.com/wbond/package_control/issues/1416#issuecomment-1418250919

CurlDownloader

from package_control.downloaders.curl_downloader import CurlDownloader;dl = CurlDownloader({"debug": True});data = dl.download("https://github.com/SublimeText/Liquid/releases/download/2.1.2/Liquid-2.1.2-st4126.sublime-package", "", 5.0, 1)

UrlLibDownloader

from package_control.downloaders.urllib_downloader import UrlLibDownloader;dl = UrlLibDownloader({"debug": True});data = dl.download("https://github.com/SublimeText/Liquid/releases/download/2.1.2/Liquid-2.1.2-st4126.sublime-package", "", 5.0, 1)

WinINetDownloader

from package_control.downloaders.wininet_downloader import WinINetDownloader;dl = WinINetDownloader({"debug": True});data = dl.download("https://github.com/SublimeText/Liquid/releases/download/2.1.2/Liquid-2.1.2-st4126.sublime-package", "", 5.0, 1)

Are there any examples or sceanarios which are not covered by the current implementation?

rchl commented 11 months ago

The oscrypto one doesn't seem to support redirect and that's what review bot uses by default on linux and mac.

deathaxe commented 11 months ago

Interesting finding.

Maybe we should come back to https://github.com/wbond/package_control_channel/issues/8050 and use your refactored reviewer via Github Actions.

rchl commented 11 months ago

I don't see why not. Just someone needs to do it.

The actions should probably be moved to some sublime-text specific repo rather than living in sublime_lsp org.