File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -378,8 +378,16 @@ function request_methods:go(timeout)
378378 if proxy then
379379 if type (proxy ) == " string" then
380380 proxy = assert (uri_patt :match (proxy ), " invalid proxy URI" )
381+ proxy .path = nil -- ignore proxy.path component
381382 else
382383 assert (type (proxy ) == " table" and getmetatable (proxy ) == nil and proxy .scheme , " invalid proxy URI" )
384+ proxy = {
385+ scheme = proxy .scheme ;
386+ userinfo = proxy .userinfo ;
387+ host = proxy .host ;
388+ port = proxy .port ;
389+ -- ignore proxy.path component
390+ }
383391 end
384392 if proxy .scheme == " http" or proxy .scheme == " https" then
385393 if tls then
@@ -423,9 +431,6 @@ function request_methods:go(timeout)
423431 if request_headers :get (" :method" ) == " CONNECT" then
424432 error (" cannot use HTTP Proxy with CONNECT method" )
425433 end
426- if proxy .path ~= nil and proxy .path ~= " " then
427- error (" an HTTP proxy cannot have a path component" )
428- end
429434 -- TODO: Check if :path already has authority?
430435 local old_url = self :to_uri (false )
431436 host = assert (proxy .host , " proxy is missing host" )
You can’t perform that action at this time.
0 commit comments