mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Update to use new backend, package downloader will follow redirects
This commit is contained in:
@@ -2,7 +2,7 @@ class W3DHub
|
||||
class Api
|
||||
LOG_TAG = "W3DHub::Api".freeze
|
||||
|
||||
API_TIMEOUT = 10 # seconds
|
||||
API_TIMEOUT = 30 # seconds
|
||||
USER_AGENT = "Cyberarm's Linux Friendly W3D Hub Launcher v#{W3DHub::VERSION}".freeze
|
||||
DEFAULT_HEADERS = {
|
||||
"User-Agent": USER_AGENT,
|
||||
@@ -42,7 +42,7 @@ class W3DHub
|
||||
|
||||
#! === W3D Hub API === !#
|
||||
|
||||
ENDPOINT = "https://secure.w3dhub.com".freeze
|
||||
ENDPOINT = "https://w3dhub-api.w3d.cyberarm.dev" # "https://secure.w3dhub.com".freeze # "https://example.com" # "http://127.0.0.1:9292".freeze #
|
||||
API_CONNECTION = Excon.new(ENDPOINT, persistent: true)
|
||||
|
||||
def self.excon(method, url, headers = DEFAULT_HEADERS, body = nil, api = :api)
|
||||
|
||||
@@ -118,7 +118,8 @@ class W3DHub
|
||||
headers: headers,
|
||||
body: "data=#{JSON.dump({ category: package.category, subcategory: package.subcategory, name: package.name, version: package.version })}",
|
||||
chunk_size: 50_000,
|
||||
response_block: streamer
|
||||
response_block: streamer,
|
||||
middlewares: Excon.defaults[:middlewares] + [Excon::Middleware::RedirectFollower]
|
||||
)
|
||||
|
||||
response.status == 200 || response.status == 206
|
||||
|
||||
Reference in New Issue
Block a user