Forum OpenACS Q&A: a small fix to util_httpopen (4.x & 3.x)

where it's setting up the headers it should have another line,

            _ns_http_puts $timeout $wfd "Host: $host
"

so it works with sites doing virtual hosting.

Collapse
Posted by Don Baccus on
Would you mind submitting a patch to both the 3.x and 4.x SDM?  It won't get into 4.5 at this point ...
Collapse
Posted by Jonathan Ellis on
I used to go through the effort of generating a patch, scp-ing to a machine with a web browser, and uploading, but that was back when I thought the core cared about the sdm.  That was before I realized if you don't have cvs access nobody gives a crap, 3.x-wise.  So I post to bboard so someone who notices a problem can find the fix and patch himself...  Inefficient but hopefully better than nothing.
<p>
Before flaming look at the 3.x open issue list (many with fixes given in the issue description) or unapplied patch list -- better yet, check the <a href="/sdm/package-patches.tcl?package_id=1&display=Accepted">applied patch list</a>.
<p>
And yes I know the mantra "4.x is our focus blah blah blah" by heart thanks.  Still there's a lot of people, me included, running sites on 3.x.
Collapse
Posted by Nis Jørgensen on
Could someone perhaps apply this? I pasted in the patch below (the bug tracker is too big a pain).

Index: utilities-procs.tcl
===================================================================
RCS file: /usr2/cvsroot/ctk/packages/acs-tcl/tcl/utilities-procs.tcl,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 utilities-procs.tcl
--- utilities-procs.tcl 7 Jun 2004 09:16:44 -0000       1.1.1.1
+++ utilities-procs.tcl 28 Jan 2005 09:00:35 -0000
@@ -1529,6 +1529,7 @@
     set wfd [lindex $fds 1]
     if { [catch {
         _ns_http_puts $timeout $wfd "$method $uri HTTP/1.0\r"
+        _ns_http_puts $timeout $wfd "Host: $host"
         if {$rqset != ""} {
             for {set i 0} {$i < [ns_set size $rqset]} {incr i} {
                 _ns_http_puts $timeout $wfd \
Collapse
Posted by Jade Rubick on
Nis, what in particular do you find to be a pain about the bug-tracker? Are you aware that it's recently been sped up and improved?

Also, do you need a \r at the end of your line? I committed it as you requested.

If you need write access to CVS, just write the OCT, and they will give you access.

Collapse
Posted by Nis Jørgensen on
- I believe there should be an \r at the end of the line. I don't know if any webservers are actually anal enough to require this. Also, I am wondering if this is portable to windows - seems this will end up sending CRCRLF.

- The bug tracker has indeed improved. The main problem now is the lack of search functionality.

Collapse
Posted by Don Baccus on
Ahh, yes, good point ... search functionality ... :)