Overview
| Artifact ID: | 2f3f6b344780be653c14c83c2a3c85f2d9ef1467920eafeb27d014b50972cea9 |
|---|---|
| Ticket: | e5ed1bb28bd172a94930d7c7a190b4d524521f69
Issue if URL contains numeric IPv6 address |
| User & Date: | anonymous on 2022-04-03 17:30:13 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed 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 changed to: "2.9.5, 2.10, ???"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "97cf2819eb5714572703833980f8863ede11fec8"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "29. http Package"
- title changed to: "Issue if URL contains numeric IPv6 address"
- type changed to: "Bug"