Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.206 -r1.207 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 8 Jun 2025 09:57:53 -0000 1.206 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 24 Sep 2025 15:37:46 -0000 1.207 @@ -1751,6 +1751,7 @@ @see util_user_message @see ad_script_abort } { + #ad_log warning "ad_returnredirect allow_complete_url $allow_complete_url_p target_url <$target_url>" if {$message ne ""} { # # Leave a hint, that we do not want to be consumed on the @@ -1761,6 +1762,7 @@ } if { [util_complete_url_p $target_url] } { + #ns_log notice "ad_returnredirect is complete <$target_url>" # http://myserver.com/foo/bar.tcl style - just pass to ns_returnredirect # check if the hostname matches the current host if {[util::external_url_p $target_url] && !$allow_complete_url_p} { @@ -1773,6 +1775,7 @@ # set url [expr {[::acs::icanuse "relative redirects"] ? "" : [util_current_location]}] append url $target_url + #ns_log notice "ad_returnredirect path is absolute, updated URL <$url>" } else { # # URL is relative to current directory. @@ -1782,11 +1785,13 @@ if {$target_url ne "."} { append url $target_url } + #ns_log notice "ad_returnredirect path is relative, updated URL <$url>" } # Sanitize URL to avoid potential injection attack regsub -all -- {[\r\n]} $url "" url + #ns_log notice "ad_returnredirect final redirect to <$url>" ns_returnredirect $url } @@ -1901,6 +1906,7 @@ @see security::configured_driver_info } { + #ns_log notice "util_driver_info -driver <$driver>" if {$driver eq ""} { set driver [ad_conn driver] @@ -1923,12 +1929,40 @@ set d [list proto https port [ns_config -int $section ServerPort] address [ns_config $section address]] } default { - #ns_log notice "Unknown driver: [ad_conn driver]. Only know nssock, nsunix, nsssl, nsssle, nsopenssl" - set d [list proto http port [ns_config -int $section Port] address [ns_config $section address]] + set d "" + try { + foreach drv [ns_driver info -server [ns_info server]] { + #ns_log notice "util_driver_info driver <$driver> check $drv" + if {[dict get $drv module] eq $driver} { + lappend d \ + proto [dict get $drv protocol] \ + address [dict get $drv address] \ + port [dict get $drv port] + #ns_log notice "util_driver_info for driver '$driver>' -> <$d>" + break + } + } + } on error {errorMsg} { + # Maybe an older version of NaviServer + } + if {[llength $d] == 0} { + ns_log warning "Unknown driver: '$driver'" + set d [list proto http port [ns_config -int $section Port] address [ns_config $section address]] + } } } - lappend d hostname [ns_config $section hostname] + set hostname [ns_config $section hostname] + if {$hostname eq ""} { + # Try to get hostname from linked driver configuration (h3) + set hostname [ns_config [ns_config $section https] hostname] + } + if {$hostname eq ""} { + ns_log error "util_driver_info: no 'hostname' specified in section '$section'" + } + lappend d hostname $hostname + #ns_log notice "util_driver_info returns <$d>" + if {[info exists array]} { upvar $array result array set result $d @@ -1962,6 +1996,7 @@ try { set urlInfo [ns_parseurl $location] + } on error {errorMsg} { # # Here we cannot use "ad_log warning", since it calls @@ -4349,7 +4384,7 @@ set local_path $resource_dir #ns_log notice UTILITY uses resource_dir '$local_path' - + if {$version_segment ne ""} { append local_path /$version_segment append download_prefix /$version_segment @@ -4547,7 +4582,7 @@ -source [dict get $versionCheckAPI cdn] \ -library $library \ -count [dict get $versionCheckAPI count]] - + switch [dict get $versionCheckAPI cdn] { cdnjs { set json [http_get_with_default \