16 Commits

Author SHA1 Message Date
Sam Ford
94449d07c0
parse_curl_response: Handle duplicate headers
`Curl#parse_curl_response` only includes the last instance of a given
header in its `:headers` hash (replicating pre-existing behavior).
This is a problem for headers like `Set-Cookie`, which can appear more
than once in a response.

This commit addresses the issue by collecting duplicate headers into
an array instead. Headers that only appear once in the response will
still have a string value but headers that appear more than once will
be an array of strings. Whenever headers from `#parse_curl_response`
are used (directly or indirectly), it's important to conditionally
handle the expected types.
2022-05-06 10:51:22 -04:00
Sam Ford
9171eb2e16
Curl: Add methods to parse response 2022-04-20 23:47:51 -04:00
Sam Ford
d44979fa67
Curl#curl_args: Fix and refactor options 2021-09-07 14:13:17 -04:00
Sam Ford
27b7713f1e
Expand tests for Curl#curl_args 2020-12-19 18:13:15 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Vítor Galvão
2e8aa3eb97 Use long --disable instead of short -q in curl 2020-03-29 20:04:37 +01:00
Markus Reiter
50b61fa7f2 Retry curl requests 3 times by default. 2020-03-20 18:40:43 +01:00
Maik Riechert
e113fd70be add HOMEBREW_CURL_RETRIES 2019-05-18 13:23:08 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
78eba5b815
Autofix RuboCop RSpec failures 2018-09-20 13:36:42 +01:00
Markus Reiter
8ae284e871 Use SystemCommand for curl. 2018-08-01 01:04:42 +02:00
ilovezfs
cd2b85c40f
Revert "Use SystemCommand for curl." 2018-07-29 21:45:04 -07:00
Markus Reiter
355df64d93 Use SystemCommand for curl. 2018-07-29 01:23:33 +02:00
Mike McQuaid
ae5e904c08 Only read curlrc if HOMEBREW_CURLRC is set.
This reverses the previous, incorrect order.
2018-04-09 15:43:03 -07:00
Mike McQuaid
d331c47de0 diagnostic: remove check_user_curlrc check. 2018-04-08 16:07:21 -07:00
Stefan Sundin
0ec47813f1 Prevent .curlrc from being loaded. 2018-04-06 14:13:26 -07:00