Skip to content

Commit 865b4c6

Browse files
authored
fix(request_uri) use uri host for ssl-server-name (#237)
also fixes an incorrect note in the docs fixes #236
1 parent faf7b45 commit 865b4c6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ When the request is successful, `res` will contain the following fields:
255255

256256
`syntax: res, err = httpc:request_uri(uri, params)`
257257

258-
The single-shot interface (see [usage](#Usage)). Since this method performs an entire end-to-end request, options specified in the `params` can include anything found in both [connect](#connect) and [request](#request) documented above. Note also that fields in `params` will override relevant components of the `uri` if specified.
258+
The single-shot interface (see [usage](#Usage)). Since this method performs an entire end-to-end request, options specified in the `params` can include anything found in both [connect](#connect) and [request](#request) documented above. Note also that fields `path`, and `query`, in `params` will override relevant components of the `uri` if specified (`scheme`, `host`, and `port` will always be taken from the `uri`).
259259

260260
There are 3 additional parameters for controlling keepalives:
261261

Diff for: lib/resty/http.lua

+1
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ function _M.request_uri(self, uri, params)
899899
params.scheme, params.host, params.port, path, query = unpack(parsed_uri)
900900
params.path = params.path or path
901901
params.query = params.query or query
902+
params.ssl_server_name = params.ssl_server_name or params.host
902903
end
903904

904905
do

0 commit comments

Comments
 (0)