Artifacts Associated With Ticket 504508ffffffffffffffffffffffffffffffffff
Ticket change [86cb2133b0] (rid 131580) by apulsifer on 2002-01-16 18:15:10:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
http.tcl v2.4 generates a header line in the http request that reads: Host: www.domain.com:80 I have discovered a server (sorry, can't say where) that tries to 302 redirect you to "www.domain.com" when you request a document from "www.domain.com:80". Yeh, I know its stupid, but since I have no control over the server, the only reasonable work around is to patch http.tcl. When patched as follows, it works great: old code: puts $s "Host: $host:$port" new code: if {$port == 80} { puts $s "Host: $host" } else { puts $s "Host: $host:$port" } I suggest making this change to http.tcl in order to make it more tolerant of brain damaged servers. Thanks. - foundin initialized to: "obsolete: 8.3.4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "apulsifer"
- subsystem initialized to: "29. http Package"
- title initialized to: "port 80 in "Host:" request header"
- type initialized to: "Bug"
Ticket change [b9b19b7eb8] (rid 129193) by hobbs on 2002-01-17 01:23:52:
- closedate changed to: "2002-01-16T18:23:52"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 Can you say what the server was? That seems inane, since the host:port specification is 100% correct with the RFC. I'd register this as a bug against the server, rather than Tcl.
- login: "hobbs"
- mimetype: "text/plain"
- status changed to: "Pending"
- title changed to: "port 80 in "Host:" request header"
- username: "hobbs"
Ticket change [931e0a7f61] (rid 105760) by apulsifer on 2002-01-17 01:47:53:
- icomment:
Logged In: YES user_id=429383 I agree, its not a very robust server. Since the port value in the header is optional, this patch would make the http package more tolerate of bad server code. BTW, after looking at the RFC, I realize the patch should read (in pseudocode): if {$port == [default port for the selected protocol]} { - login: "apulsifer"
- mimetype: "text/plain"
- status changed to: "Open"
- title changed to: "port 80 in "Host:" request header"
- username: "apulsifer"
- icomment:
Ticket change [6c892a271d] (rid 128529) by apulsifer on 2002-01-17 02:38:41:
- closedate changed to: "2002-01-16T19:38:41"
- closer changed to: "apulsifer"
- icomment:
Logged In: YES user_id=429383 I agree, its not a very robust server. Since the port value in the header is optional, this patch would make the http package more tolerate of bad server code. BTW, after looking at the RFC, I realize the patch should read (in pseudocode): if {$port == [default port for the selected protocol]} { - login: "apulsifer"
- mimetype: "text/plain"
- status changed to: "Pending"
- title changed to: "port 80 in "Host:" request header"
- username: "apulsifer"
Ticket change [923b51945d] (rid 120737) by hobbs on 2002-01-25 05:38:56:
- icomment:
Logged In: YES user_id=72656 I'd still note this as a server bug, because this might not be a robust patch in Tcl. https and other support protocols might prevent the above from behaving properly.
- login: "hobbs"
- mimetype: "text/plain"
- status changed to: "Open"
- title changed to: "port 80 in "Host:" request header"
- username: "hobbs"
- icomment:
Ticket change [f6aac5bebf] (rid 130334) by apulsifer on 2002-01-25 07:39:04:
- icomment:
Logged In: YES user_id=429383 I think it would solve 99% of the problems if you changed it to: if {$port == 80 && "protocol" == "http"} { puts $s "Host: $host" } else { puts $s "Host: $host:$port" } Note I downgraded to v8.3.2 and it doesn't have this problem. Thanks, Allen - login: "apulsifer"
- mimetype: "text/plain"
- title changed to: "port 80 in "Host:" request header"
- username: "apulsifer"
- icomment:
Ticket change [b23745fae5] (rid 98294) by hobbs on 2002-01-25 08:31:53:
- closedate changed to: "2002-01-25T01:31:53"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 ok, went with the last solution to that restricts it to http proto, to stay on the safe side. This is in 8.4a4cvs.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- title changed to: "port 80 in "Host:" request header"
- username: "hobbs"
Add attachment "http-port80.txt" [7923693d4c] (rid 90075) by hobbs on 2002-01-25 10:01:08.
Ticket change [c31b25b24f] (rid 111598) by hobbs on 2002-01-25 10:01:08:
- closedate changed to: "2002-01-25T03:01:08"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 Found a server that reliably exhibits this bug: http://www.weather.com/weather/local/24060 From the geturl headers, the server is Apache/1.3.12 (Unix) mod_oas/5.1/ This obviously violates the RFC: http://www.w3.org/Protocols/rfc2616/rfc2616- sec14.html#sec14.23 Anyway, I'm back-porting to core-8-3-1-branch in case that ever goes out as well. I'm also removing the "http" only restriction, because now that I see this happen, I can't rely on broken servers to hopefully server https right either. I've attached the 8.4a4cvs patch.
- login: "hobbs"
- mimetype: "text/plain"
- title changed to: "port 80 in "Host:" request header"
- username: "hobbs"
Ticket change [4c886ee915] (rid 126907) by hobbs on 2002-01-25 10:01:09:
- icomment:
File Added - 16729: http-port80.txt
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [5944396210] (rid 117949) by cleverly on 2002-08-25 09:17:11:
- icomment:
Logged In: YES user_id=22080 Just for the record, PowerDNS that does the redirection for wiki.tcl.tk is also brain-dead/broken with regards to: "Host: wiki.tcl.tk:80" :-(
- login: "cleverly"
- mimetype: "text/plain"
- username: "cleverly"
- icomment: