-
-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Labels
Description
hi, my $http_proxy
is set to http://127.0.0.1:8118/
. this works fine with all other programs (chromium, curl, ...). http.request asserts when the trailing slash is present. here's a patch to fix it.
diff --git a/http/request.lua b/http/request.lua
index 3f12a8f..ce1cb88 100644
--- a/http/request.lua
+++ b/http/request.lua
@@ -59,7 +59,7 @@ local function new_from_uri(uri_t, headers)
is_connect = headers:get(":method") == "CONNECT"
end
if is_connect then
- assert(uri_t.path == nil or uri_t.path == "", "CONNECT requests cannot have a path")
+ assert(uri_t.path == nil or uri_t.path == "" or uri_t.path == "/", "CONNECT requests cannot have a path")
assert(uri_t.query == nil, "CONNECT requests cannot have a query")
assert(headers:has(":authority"), ":authority required for CONNECT requests")
else