From 1c622a7ca277c44b6137367b720ed3db61218ca9 Mon Sep 17 00:00:00 2001 From: andreask Date: Wed, 7 Mar 2012 18:50:48 +0000 Subject: http package. Fix Bug 3498327. Generate upper-case hexadecimal output for compliance with RFC 3986. Bumped version to 2.5.7. --- ChangeLog | 6 ++++++ library/http/http.tcl | 6 +++--- library/http/pkgIndex.tcl | 2 +- tests/http.test | 12 ++++++------ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d67e66..e3a0fa1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-03-07 Andreas Kupries + + * library/http/http.tcl: [Bug 3498327]: Generate upper-case + * library/http/pkgIndex.tcl: hexadecimal output for compliance + * tests/http.test: with RFC 3986. Bumped version to 2.5.7. + 2012-03-06 Jan Nijtmans * win/tclWinPort.h: Compatibility with older Visual Studio versions. diff --git a/library/http/http.tcl b/library/http/http.tcl index bc8ae7f..ceef043 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -22,7 +22,7 @@ package require Tcl 8.4 # Keep this in sync with pkgIndex.tcl and with the install directories # in Makefiles -package provide http 2.5.6 +package provide http 2.5.7 namespace eval http { variable http @@ -44,11 +44,11 @@ namespace eval http { for {set i 0} {$i <= 256} {incr i} { set c [format %c $i] if {![string match {[-._~a-zA-Z0-9]} $c]} { - set map($c) %[format %.2x $i] + set map($c) %[format %.2X $i] } } # These are handled specially - set map(\n) %0d%0a + set map(\n) %0D%0A variable formMap [array get map] } init diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index 6c574ef..c5d2928 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.5.6 [list tclPkgSetup $dir http 2.5.6 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.5.7 [list tclPkgSetup $dir http 2.5.7 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] diff --git a/tests/http.test b/tests/http.test index f8a79be..54fa369 100644 --- a/tests/http.test +++ b/tests/http.test @@ -477,17 +477,17 @@ test http-5.1 {http::formatQuery} { # test http-5.2 obsoleted by 5.4 and 5.5 with http 2.5 test http-5.3 {http::formatQuery} { http::formatQuery lines "line1\nline2\nline3" -} {lines=line1%0d%0aline2%0d%0aline3} +} {lines=line1%0D%0Aline2%0D%0Aline3} test http-5.4 {http::formatQuery} { http::formatQuery name1 ~bwelch name2 \xa1\xa2\xa2 -} {name1=~bwelch&name2=%c2%a1%c2%a2%c2%a2} +} {name1=~bwelch&name2=%C2%A1%C2%A2%C2%A2} test http-5.5 {http::formatQuery} { set enc [http::config -urlencoding] http::config -urlencoding iso8859-1 set res [http::formatQuery name1 ~bwelch name2 \xa1\xa2\xa2] http::config -urlencoding $enc set res -} {name1=~bwelch&name2=%a1%a2%a2} +} {name1=~bwelch&name2=%A1%A2%A2} test http-6.1 {http::ProxyRequired} { http::config -proxyhost [info hostname] -proxyport $port @@ -503,12 +503,12 @@ test http-6.1 {http::ProxyRequired} { test http-7.1 {http::mapReply} { http::mapReply "abc\$\[\]\"\\()\}\{" -} {abc%24%5b%5d%22%5c%28%29%7d%7b} +} {abc%24%5B%5D%22%5C%28%29%7D%7B} test http-7.2 {http::mapReply} { # RFC 2718 specifies that we pass urlencoding on utf-8 chars by default, # so make sure this gets converted to utf-8 then urlencoded. http::mapReply "\u2208" -} {%e2%88%88} +} {%E2%88%88} test http-7.3 {http::formatQuery} { set enc [http::config -urlencoding] # this would be reverting to http <=2.4 behavior @@ -525,7 +525,7 @@ test http-7.4 {http::formatQuery} { set res [http::mapReply "\u2208"] http::config -urlencoding $enc set res -} {%3f} +} {%3F} # cleanup catch {unset url} -- cgit v0.12