diff --git a/docs/Utils/Curl.html b/docs/Utils/Curl.html index f099be030..d79aeade5 100644 --- a/docs/Utils/Curl.html +++ b/docs/Utils/Curl.html @@ -593,12 +593,12 @@
-43 -44 -45+53 +54 +55
# File 'utils/curl.rb', line 43 +# File 'utils/curl.rb', line 53 def clear_path_cache @curl_path = nil @@ -637,14 +637,14 @@
-175 -176 -177 -178 -179+185 +186 +187 +188 +189
# File 'utils/curl.rb', line 175 +# File 'utils/curl.rb', line 185 def curl(*args, print_stdout: true, **) result = curl_with_workarounds(*args, print_stdout:, **) @@ -817,16 +817,6 @@
-60 -61 -62 -63 -64 -65 -66 -67 -68 -69 70 71 72 @@ -880,10 +870,20 @@+123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133120 121 122 -123
# File 'utils/curl.rb', line 60 +# File 'utils/curl.rb', line 70 def curl_args( *extra_args, @@ -983,19 +983,6 @@
-270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 283 284 285 @@ -1111,10 +1098,23 @@+398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411395 396 397 -398
# File 'utils/curl.rb', line 270 +# File 'utils/curl.rb', line 283 def curl_check_http_content(url, url_type, specs: {}, user_agents: [:default], referer: nil, check_content: false, strict: false, use_homebrew_curl: false) @@ -1279,16 +1279,6 @@
-181 -182 -183 -184 -185 -186 -187 -188 -189 -190 191 192 193 @@ -1310,10 +1300,20 @@+212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222209 210 211 -212
# File 'utils/curl.rb', line 181 +# File 'utils/curl.rb', line 191 def curl_download(*args, to: nil, try_partial: false, **) destination = Pathname(to) @@ -1381,14 +1381,14 @@
-33 -34 -35 -36 -37+43 +44 +45 +46 +47
# File 'utils/curl.rb', line 33 +# File 'utils/curl.rb', line 43 def curl_executable(use_homebrew_curl: false) return HOMEBREW_BREWED_CURL_PATH if use_homebrew_curl @@ -1429,16 +1429,6 @@
-218 -219 -220 -221 -222 -223 -224 -225 -226 -227 228 229 230 @@ -1454,10 +1444,23 @@+243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256240 241 242 -243
# File 'utils/curl.rb', line 218 +# File 'utils/curl.rb', line 228 def curl_headers(*args, wanted_headers: [], **) [[], ["--request", "GET"]].each do |request_args| @@ -1466,8 +1469,10 @@** ) - # 22 means a non-successful HTTP status code, not a `curl` error, so we still got some headers. - if result.success? || result.exit_status == 22 + # We still receive usable headers with certain non-successful exit + # statuses, so we special case them below. + if result.success? || + [CURL_WEIRD_SERVER_REPLY_EXIT_CODE, CURL_HTTP_RETURNED_ERROR_EXIT_CODE].include?(result.exit_status) parsed_output = parse_curl_output(result.stdout) if request_args.empty? @@ -1479,7 +1484,8 @@
next if (400..499).cover?(parsed_output.fetch(:responses).last&.fetch(:status_code).to_i) end - return parsed_output if result.success? + return parsed_output if result.success? || + result.exit_status == CURL_WEIRD_SERVER_REPLY_EXIT_CODE end result.assert_success! @@ -1519,19 +1525,6 @@
-400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 413 414 415 @@ -1590,10 +1583,23 @@+471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484468 469 470 -471
# File 'utils/curl.rb', line 400 +# File 'utils/curl.rb', line 413 def curl_http_content_headers_and_checksum( url, specs: {}, hash_needed: false, @@ -1701,12 +1707,12 @@
-214 -215 -216+224 +225 +226
# File 'utils/curl.rb', line 214 +# File 'utils/curl.rb', line 224 def curl_output(*args, **) curl_with_workarounds(*args, print_stderr: false, show_output: true, **) @@ -1745,12 +1751,12 @@
-39 -40 -41+49 +50 +51
# File 'utils/curl.rb', line 39 +# File 'utils/curl.rb', line 49 def curl_path @curl_path ||= Utils.popen_read(curl_executable, "--homebrew=print-path").chomp.presence @@ -1842,21 +1848,21 @@
-566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577+579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590
# File 'utils/curl.rb', line 566 +# File 'utils/curl.rb', line 579 def curl_response_follow_redirections(responses, base_url) responses.each do |response| @@ -1979,22 +1985,22 @@
-541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553+554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566
# File 'utils/curl.rb', line 541 +# File 'utils/curl.rb', line 554 def curl_response_last_location(responses, absolutize: false, base_url: nil) responses.reverse_each do |response| @@ -2056,15 +2062,15 @@
-473 -474 -475 -476 -477 -478+486 +487 +488 +489 +490 +491
# File 'utils/curl.rb', line 473 +# File 'utils/curl.rb', line 486 def curl_supports_fail_with_body? @curl_supports_fail_with_body ||= Hash.new do |h, key| @@ -2119,15 +2125,15 @@
-480 -481 -482 -483 -484 -485+493 +494 +495 +496 +497 +498
# File 'utils/curl.rb', line 480 +# File 'utils/curl.rb', line 493 def curl_supports_tls13? @curl_supports_tls13 ||= Hash.new do |h, key| @@ -2182,16 +2188,6 @@
-125 -126 -127 -128 -129 -130 -131 -132 -133 -134 135 136 137 @@ -2230,10 +2226,20 @@+173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183170 171 172 -173
# File 'utils/curl.rb', line 125 +# File 'utils/curl.rb', line 135 def curl_with_workarounds( *args, @@ -2331,12 +2337,12 @@
-487 -488 -489+500 +501 +502
# File 'utils/curl.rb', line 487 +# File 'utils/curl.rb', line 500 def http_status_ok?(status) (100..299).cover?(status.to_i) @@ -2437,29 +2443,29 @@
-504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 517 518 519 520 521 522 -523+523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536
# File 'utils/curl.rb', line 504 +# File 'utils/curl.rb', line 517 def parse_curl_output(output, max_iterations: 25) responses = [] @@ -2553,15 +2559,15 @@
-250 -251 -252 -253 -254 -255+263 +264 +265 +266 +267 +268
# File 'utils/curl.rb', line 250 +# File 'utils/curl.rb', line 263 def url_protected_by_cloudflare?(response) return false if response[:headers].blank? @@ -2641,16 +2647,16 @@
-262 -263 -264 -265 -266 -267 -268+275 +276 +277 +278 +279 +280 +281
# File 'utils/curl.rb', line 262 +# File 'utils/curl.rb', line 275 def url_protected_by_incapsula?(response) return false if response[:headers].blank?