Skip to content

Commit 5dd9e6a

Browse files
oowlwindmgc
authored andcommitted
feat: support http_proxy_authorization and https_proxy_authorization options
1 parent 002d203 commit 5dd9e6a

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

spec/02-requests/03-execute_spec.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ describe("request execution", function()
192192
local proxy_opts = {
193193
http_proxy = 'http://test-http-proxy:1234',
194194
https_proxy = 'http://test-https-proxy:4321',
195+
http_proxy_authorization = 'Basic dGVzdF91c2VyOnRlc3RfcGFzc3c=',
196+
https_proxy_authorization = 'Basic dGVzdF91c2VyOnRlc3RfcGFzc3c=',
195197
no_proxy = '127.0.0.1,localhost'
196198
}
197199

@@ -200,6 +202,8 @@ describe("request execution", function()
200202
aws.config.http_proxy = proxy_opts.http_proxy
201203
aws.config.https_proxy = proxy_opts.https_proxy
202204
aws.config.no_proxy = proxy_opts.no_proxy
205+
aws.config.http_proxy_authorization = proxy_opts.http_proxy_authorization
206+
aws.config.https_proxy_authorization = proxy_opts.https_proxy_authorization
203207

204208
local s3 = aws:S3()
205209

src/resty/aws/request/signatures/presign.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ local function presign_awsv4_request(config, request_data, service, region, expi
137137
local proxy_opts = {
138138
http_proxy = config.http_proxy,
139139
https_proxy = config.https_proxy,
140+
http_proxy_authorization = config.http_proxy_authorization,
141+
https_proxy_authorization = config.https_proxy_authorization,
140142
no_proxy = config.no_proxy,
141143
}
142144

src/resty/aws/request/signatures/v4.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ local function prepare_awsv4_request(config, request_data)
8181
local proxy_opts = {
8282
http_proxy = config.http_proxy,
8383
https_proxy = config.https_proxy,
84+
http_proxy_authorization = config.http_proxy_authorization,
85+
https_proxy_authorization = config.https_proxy_authorization,
8486
no_proxy = config.no_proxy,
8587
}
8688

0 commit comments

Comments
 (0)