Artifacts Associated With Ticket e5ed1bb28b
Ticket change [2f3f6b3447] (rid 199902) by anonymous on 2022-04-03 17:30:13:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
While procedure "::http::geturl" is working correctly with host names and numeric IPv4 addresses (e.g. loopback address "127.0.0.1"), it is failing with numeric IPv6 addresses (e.g. loopback address "::1"). Example: package require http set url "http://\[::1\]:8080/0/0/0.png" set rc [catch {::http::geturl $url} token] set ncode [::http::ncode $token] set data [::http::data $token] Result: rc = 0 token = ::http::1 ncode = 400 data = "<h1>Bad Message 400</h1><pre>reason: Bad HostPort</pre>" Reason: URL's host and port parts are concatenated and saved in local variable "state(socketinfo)" by statement set state(socketinfo) $host:$port -> state(socketinfo) = ::1:8080 and later on, host and port are restored from local variable by following statements set host [lindex [split $state(socketinfo) :] 0] set port [lindex [split $state(socketinfo) :] 1] -> host = "" port = "" Solution: Restoring host and port from local variable by statement regexp {(.+):([^:]+)} $state(socketinfo) {} host port -> host = "::1" port = "8080" is working with IPv4 and IPv6 addresses as well as with host names: set rc [catch {::http::geturl $url} token] set ncode [::http::ncode $token] set data [::http::data $token] Result: rc = 0 token = ::http::1 ncode = 200 data = <response as expected from web server> - foundin initialized to: "2.9.5, 2.10, ???"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "97cf2819eb5714572703833980f8863ede11fec8"
- resolution initialized to: "None"
- severity initialized to: "Severe"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "29. http Package"
- title initialized to: "Issue if URL contains numeric IPv6 address"
- type initialized to: "Bug"
Ticket change [82cad836db] (rid 199927) by jan.nijtmans on 2022-04-04 11:51:21:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459673.99399623"
- closer changed to: "jan.nijtmans"
- icomment:
Fixed in all branches now. Thanks!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"