From 5ff981ecc108f79a2617a11d6294740876ebc8d1 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 19 Nov 2025 18:07:10 -0800 Subject: [PATCH] request: fix a handful of changes from backport --- app/lib/request.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/lib/request.rb b/app/lib/request.rb index 5196265ac..3db5d1788 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -76,8 +76,13 @@ class Request @http_client = options.delete(:http_client) @allow_local = options.delete(:allow_local) @full_path = !options.delete(:omit_query_string) - @options = options.merge(socket_class: use_proxy? || @allow_local ? ProxySocket : Socket) - @options = @options.merge(timeout_class: PerOperationWithDeadline, timeout_options: TIMEOUT) + @options = { + follow: { + max_hops: 3, + on_redirect: ->(response, request) { re_sign_on_redirect(response, request) }, + }, + socket_class: use_proxy? || @allow_local ? ProxySocket : Socket, + }.merge(options) @options = @options.merge(proxy_url) if use_proxy? @headers = {} @@ -158,14 +163,6 @@ class Request @headers['Digest'] = "SHA-256=#{Digest::SHA256.base64digest(@options[:body])}" end - def request_target - if @url.query.nil? || !@full_path - "#{@verb} #{@url.path}" - else - "#{@verb} #{@url.path}?#{@url.query}" - end - end - def signature @signing.sign(@headers.without('User-Agent', 'Accept-Encoding'), @verb, @url) end