Index: openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl,v diff -u -r1.30.2.33 -r1.30.2.34 --- openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl 17 Jul 2024 12:34:55 -0000 1.30.2.33 +++ openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl 30 Jul 2024 11:27:54 -0000 1.30.2.34 @@ -1407,7 +1407,10 @@ } { set this_proc [lindex [info level 0] 0] - if {![regexp "^(https|http)://*" $url]} { + set parsed_url [ns_parseurl $url] + + if {![dict exists $parsed_url proto] || + [dict get $parsed_url proto] ni {"http" "https"}} { return -code error "${this_proc}: Invalid url: $url" } @@ -1465,10 +1468,9 @@ set cmd [list ns_http run \ -timeout $timeout \ -method $method \ - -headers $headers] - if {[regexp {https://([^/]+)/} $url . hostname]} { - lappend cmd -hostname $hostname - } + -headers $headers \ + -hostname [dict get $parsed_url host]] + if {$body_file ne ""} { lappend cmd -body_file $body_file } elseif {$body ne ""} {