Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Attempt to fix cookiejar installation, for now UNIX-only. Please review. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | fix-cookiejar-install |
Files: | files | file ages | folders |
SHA3-256: |
fca8590e27edad1806a5240b705b2215 |
User & Date: | jan.nijtmans 2019-11-26 08:37:36.914 |
Context
2019-11-26
| ||
08:37 | Attempt to fix cookiejar installation, for now UNIX-only. Please review. Closed-Leaf check-in: fca8590e27 user: jan.nijtmans tags: fix-cookiejar-install | |
2019-11-25
| ||
17:00 | merge mark check-in: 7f8066e718 user: dgp tags: core-8-branch | |
Changes
Changes to doc/idna.n.
1 2 3 4 5 6 7 8 9 10 11 | '\" '\" Copyright (c) 2014-2018 Donal K. Fellows. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH "idna" n 0.1 http "Tcl Bundled Packages" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | '\" '\" Copyright (c) 2014-2018 Donal K. Fellows. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH "idna" n 0.1 http "Tcl Bundled Packages" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME http::idna \- Support for normalization of Internationalized Domain Names .SH SYNOPSIS .nf package require http::idna 1.0 \fBhttp::idna decode\fR \fIhostname\fR \fBhttp::idna encode\fR \fIhostname\fR \fBhttp::idna puny decode\fR \fIstring\fR ?\fIcase\fR? \fBhttp::idna puny encode\fR \fIstring\fR ?\fIcase\fR? \fBhttp::idna version\fR .fi .SH DESCRIPTION This package provides an implementation of the punycode scheme used in Internationalised Domain Names, and some access commands. (See RFC 3492 for a description of punycode.) .TP \fBhttp::idna decode\fR \fIhostname\fR . This command takes the name of a host that potentially contains punycode-encoded character sequences, \fIhostname\fR, and returns the hostname as might be displayed to the user. Note that there are often UNICODE characters that have extremely similar glyphs, so care should be taken with displaying hostnames to users. .TP \fBhttp::idna encode\fR \fIhostname\fR . This command takes the name of a host as might be displayed to the user, \fIhostname\fR, and returns the version of the hostname with characters not permitted in basic hostnames encoded with punycode. .TP \fBhttp::idna puny\fR \fIsubcommand ...\fR . This command provides direct access to the basic punycode encoder and decoder. It supports two \fIsubcommand\fRs: .RS .TP \fBhttp::idna puny decode\fR \fIstring\fR ?\fIcase\fR? . This command decodes the punycode-encoded string, \fIstring\fR, and returns the result. If \fIcase\fR is provided, it is a boolean to make the case be folded to upper case (if \fIcase\fR is true) or lower case (if \fIcase\fR is false) during the decoding process; if omitted, no case transformation is applied. .TP \fBhttp::idna puny encode\fR \fIstring\fR ?\fIcase\fR? . This command encodes the string, \fIstring\fR, and returns the punycode-encoded version of the string. If \fIcase\fR is provided, it is a boolean to make the case be folded to upper case (if \fIcase\fR is true) or lower case (if \fIcase\fR is false) during the encoding process; if omitted, no case transformation is applied. .RE .TP \fBhttp::idna version\fR . This returns the version of the \fBhttp::idna\fR package. .SH "EXAMPLE" .PP This is an example of how punycoding of a string works: .PP .CS package require http::idna puts [\fBhttp::idna puny encode\fR "abc\(->def"] # prints: \fIabcdef-kn2c\fR puts [\fBhttp::idna puny decode\fR "abcdef-kn2c"] # prints: \fIabc\(->def\fR .CE '\" TODO: show how it handles a real domain name .SH "SEE ALSO" http(n), cookiejar(n) .SH KEYWORDS internet, www |
︙ | ︙ |
Changes to library/http/cookiejar.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # cookiejar.tcl -- # # Implementation of an HTTP cookie storage engine using SQLite. The # implementation is done as a TclOO class, and includes a punycode # encoder and decoder (though only the encoder is currently used). # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Dependencies package require Tcl 8.6 package require http 2.8.4 package require sqlite3 | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # cookiejar.tcl -- # # Implementation of an HTTP cookie storage engine using SQLite. The # implementation is done as a TclOO class, and includes a punycode # encoder and decoder (though only the encoder is currently used). # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Dependencies package require Tcl 8.6 package require http 2.8.4 package require sqlite3 package require http::idna 1.0.0 # # Configuration for the cookiejar package, plus basic support procedures. # # This is the class that we are creating if {![llength [info commands ::http::cookiejar]]} { |
︙ | ︙ | |||
50 51 52 53 54 55 56 | upvar 1 ${*var} var set var [::tcl::prefix match -message "log level" \ {debug info warn error} $val] } # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | upvar 1 ${*var} var set var [::tcl::prefix match -message "log level" \ {debug info warn error} $val] } # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles variable version 0.1.0 variable domainlist \ http://publicsuffix.org/list/effective_tld_names.dat variable domainfile \ [file join [file dirname [info script]] effective_tld_names.txt.gz] # The list is directed to from http://publicsuffix.org/list/ variable loglevel info |
︙ | ︙ | |||
78 79 80 81 82 83 84 | } } namespace export * proc locn {secure domain path {key ""}} { if {$key eq ""} { format "%s://%s%s" [expr {$secure?"https":"http"}] \ | | | | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | } } namespace export * proc locn {secure domain path {key ""}} { if {$key eq ""} { format "%s://%s%s" [expr {$secure?"https":"http"}] \ [::http::idna encode $domain] $path } else { format "%s://%s%s?%s" \ [expr {$secure?"https":"http"}] [::http::idna encode $domain] \ $path $key } } proc splitDomain domain { set pieces [split $domain "."] for {set i [llength $pieces]} {[incr i -1] >= 0} {} { lappend result [join [lrange $pieces $i end] "."] |
︙ | ︙ | |||
393 394 395 396 397 398 399 | foreach line [split $data "\n"] { if {[string trim $line] eq ""} { continue } elseif {[string match //* $line]} { continue } elseif {[string match !* $line]} { set line [string range $line 1 end] | | | | | | | | | | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | foreach line [split $data "\n"] { if {[string trim $line] eq ""} { continue } elseif {[string match //* $line]} { continue } elseif {[string match !* $line]} { set line [string range $line 1 end] set idna [string tolower [::http::idna encode $line]] set utf [::http::idna decode [string tolower $line]] db eval { INSERT OR REPLACE INTO domains (domain, forbidden) VALUES ($utf, 0); } if {$idna ne $utf} { db eval { INSERT OR REPLACE INTO domains (domain, forbidden) VALUES ($idna, 0); } } } else { if {[string match {\*.*} $line]} { set line [string range $line 2 end] set idna [string tolower [::http::idna encode $line]] set utf [::http::idna decode [string tolower $line]] db eval { INSERT OR REPLACE INTO forbiddenSuper (domain) VALUES ($utf); } if {$idna ne $utf} { db eval { INSERT OR REPLACE INTO forbiddenSuper (domain) VALUES ($idna); } } } else { set idna [string tolower [::http::idna encode $line]] set utf [::http::idna decode [string tolower $line]] } db eval { INSERT OR REPLACE INTO domains (domain, forbidden) VALUES ($utf, 1); } if {$idna ne $utf} { db eval { INSERT OR REPLACE INTO domains (domain, forbidden) VALUES ($idna, 1); } } } if {$utf ne [::http::idna decode [string tolower $idna]]} { log warn "mismatch in IDNA handling for %s (%d, %s, %s)" \ $idna $line $utf [::http::idna decode $idna] } } dict with meta { set installDate [clock seconds] db eval { INSERT OR REPLACE INTO domainCacheMetadata |
︙ | ︙ | |||
514 515 516 517 518 519 520 | } } method getCookies {proto host path} { set result {} set paths [splitPath $path] if {[regexp {[^0-9.]} $host]} { | | | 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 | } } method getCookies {proto host path} { set result {} set paths [splitPath $path] if {[regexp {[^0-9.]} $host]} { set domains [splitDomain [string tolower [::http::idna encode $host]]] } else { # Ugh, it's a numeric domain! Restrict it to just itself... set domains [list $host] } set secure [string equal -nocase $proto "https"] # Open question: how to move these manipulations into the database # engine (if that's where they *should* be). |
︙ | ︙ | |||
700 701 702 703 704 705 706 | } } } forward Database db method lookup {{host ""} {key ""}} { | | | | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 | } } } forward Database db method lookup {{host ""} {key ""}} { set host [string tolower [::http::idna encode $host]] db transaction { if {$host eq ""} { set result {} db eval { SELECT DISTINCT domain FROM cookies ORDER BY domain } { lappend result [::http::idna decode [string tolower $domain]] } return $result } elseif {$key eq ""} { set result {} db eval { SELECT DISTINCT key FROM cookies WHERE domain = $host |
︙ | ︙ |
Changes to library/http/idna.tcl.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # This implementation includes code from that RFC, translated to Tcl; the # other parts are: # Copyright (c) 2014 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. | | | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # This implementation includes code from that RFC, translated to Tcl; the # other parts are: # Copyright (c) 2014 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. namespace eval ::http::idna { namespace ensemble create -command puny -map { encode punyencode decode punydecode } namespace ensemble create -command ::http::idna -map { encode IDNAencode decode IDNAdecode puny puny version {::apply {{} {package present http::idna} ::}} } proc IDNAencode hostname { set parts {} # Split term from RFC 3490, Sec 3.1 foreach part [split $hostname "\u002E\u3002\uFF0E\uFF61"] { if {[regexp {[^-A-Za-z0-9]} $part]} { |
︙ | ︙ | |||
280 281 282 283 284 285 286 | incr i } return [join $output ""] } } | | | 280 281 282 283 284 285 286 287 288 289 290 291 292 | incr i } return [join $output ""] } } package provide http::idna 1.0.0 # Local variables: # mode: tcl # fill-column: 78 # End: |
Changes to library/http/pkgIndex.tcl.
1 2 | if {![package vsatisfies [package provide Tcl] 8.6-]} {return} package ifneeded http 2.9.1 [list tclPkgSetup $dir http 2.9.1 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] | | | | 1 2 3 4 | if {![package vsatisfies [package provide Tcl] 8.6-]} {return} package ifneeded http 2.9.1 [list tclPkgSetup $dir http 2.9.1 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] package ifneeded cookiejar 0.1.0 [list source [file join $dir cookiejar.tcl]] package ifneeded http::idna 1.0.0 [list source [file join $dir idna.tcl]] |
Changes to tests/http.test.
︙ | ︙ | |||
666 667 668 669 670 671 672 | # (unknown chars become '?') http::config -urlencoding "iso8859-1" http::mapReply "\u2208" } -cleanup { http::config -urlencoding $enc } -result {%3F} | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 | # (unknown chars become '?') http::config -urlencoding "iso8859-1" http::mapReply "\u2208" } -cleanup { http::config -urlencoding $enc } -result {%3F} package require -exact http::idna 1.0 test http-idna-1.1 {IDNA package: basics} -returnCodes error -body { ::http::idna } -result {wrong # args: should be "::http::idna subcommand ?arg ...?"} test http-idna-1.2 {IDNA package: basics} -returnCodes error -body { ::http::idna ? } -result {unknown or ambiguous subcommand "?": must be decode, encode, puny, or version} test http-idna-1.3 {IDNA package: basics} -body { ::http::idna version } -result 1.0 test http-idna-1.4 {IDNA package: basics} -returnCodes error -body { ::http::idna version what } -result {wrong # args: should be "::http::idna version"} test http-idna-1.5 {IDNA package: basics} -returnCodes error -body { ::http::idna puny } -result {wrong # args: should be "::http::idna puny subcommand ?arg ...?"} test http-idna-1.6 {IDNA package: basics} -returnCodes error -body { ::http::idna puny ? } -result {unknown or ambiguous subcommand "?": must be decode, or encode} test http-idna-1.7 {IDNA package: basics} -returnCodes error -body { ::http::idna puny encode } -result {wrong # args: should be "::http::idna puny encode string ?case?"} test http-idna-1.8 {IDNA package: basics} -returnCodes error -body { ::http::idna puny encode a b c } -result {wrong # args: should be "::http::idna puny encode string ?case?"} test http-idna-1.9 {IDNA package: basics} -returnCodes error -body { ::http::idna puny decode } -result {wrong # args: should be "::http::idna puny decode string ?case?"} test http-idna-1.10 {IDNA package: basics} -returnCodes error -body { ::http::idna puny decode a b c } -result {wrong # args: should be "::http::idna puny decode string ?case?"} test http-idna-1.11 {IDNA package: basics} -returnCodes error -body { ::http::idna decode } -result {wrong # args: should be "::http::idna decode hostname"} test http-idna-1.12 {IDNA package: basics} -returnCodes error -body { ::http::idna encode } -result {wrong # args: should be "::http::idna encode hostname"} test http-idna-2.1 {puny encode: functional test} { ::http::idna puny encode abc } abc- test http-idna-2.2 {puny encode: functional test} { ::http::idna puny encode a\u20acb\u20acc } abc-k50ab test http-idna-2.3 {puny encode: functional test} { ::http::idna puny encode ABC } ABC- test http-idna-2.4 {puny encode: functional test} { ::http::idna puny encode A\u20ACB\u20ACC } ABC-k50ab test http-idna-2.5 {puny encode: functional test} { ::http::idna puny encode ABC 0 } abc- test http-idna-2.6 {puny encode: functional test} { ::http::idna puny encode A\u20ACB\u20ACC 0 } abc-k50ab test http-idna-2.7 {puny encode: functional test} { ::http::idna puny encode ABC 1 } ABC- test http-idna-2.8 {puny encode: functional test} { ::http::idna puny encode A\u20ACB\u20ACC 1 } ABC-k50ab test http-idna-2.9 {puny encode: functional test} { ::http::idna puny encode abc 0 } abc- test http-idna-2.10 {puny encode: functional test} { ::http::idna puny encode a\u20ACb\u20ACc 0 } abc-k50ab test http-idna-2.11 {puny encode: functional test} { ::http::idna puny encode abc 1 } ABC- test http-idna-2.12 {puny encode: functional test} { ::http::idna puny encode a\u20ACb\u20ACc 1 } ABC-k50ab test http-idna-2.13 {puny encode: edge cases} { ::http::idna puny encode "" } "" test http-idna-2.14-A {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644 u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F }]] ""] } egbpdaj6bu4bxfgehfvwxn test http-idna-2.14-B {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587 }]] ""] } ihqwcrb4cv8a8dqg056pqjye test http-idna-2.14-C {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587 }]] ""] } ihqwctvzc91f659drss3x8bo0yb test http-idna-2.14-D {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074 u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D u+0065 u+0073 u+006B u+0079 }]] ""] } Proprostnemluvesky-uyb24dma41a test http-idna-2.14-E {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8 u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2 u+05D1 u+05E8 u+05D9 u+05EA }]] ""] } 4dbcagdahymbxekheh6e0a7fei0b test http-idna-2.14-F {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+092F u+0939 u+0932 u+094B u+0917 u+0939 u+093F u+0928 u+094D u+0926 u+0940 u+0915 u+094D u+092F u+094B u+0902 u+0928 u+0939 u+0940 u+0902 u+092C u+094B u+0932 u+0938 u+0915 u+0924 u+0947 u+0939 u+0948 u+0902 }]] ""] } i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd test http-idna-2.14-G {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092 u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B }]] ""] } n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa test http-idna-2.14-H {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774 u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74 u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C }]] ""] } 989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c test http-idna-2.14-I {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E u+043D u+0438 u+043D u+0435 u+0433 u+043E u+0432 u+043E u+0440 u+044F u+0442 u+043F u+043E u+0440 u+0443 u+0441 u+0441 u+043A u+0438 }]] ""] } b1abfaaepdrnnbgefbadotcwatmq2g4l test http-idna-2.14-J {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+0050 u+006F u+0072 u+0071 u+0075 u+00E9 u+006E u+006F u+0070 u+0075 u+0065 u+0064 u+0065 u+006E u+0073 u+0069 u+006D u+0070 u+006C u+0065 u+006D u+0065 u+006E u+0074 u+0065 u+0068 u+0061 u+0062 u+006C u+0061 u+0072 u+0065 u+006E u+0045 u+0073 u+0070 u+0061 u+00F1 u+006F u+006C }]] ""] } PorqunopuedensimplementehablarenEspaol-fmd56a test http-idna-2.14-K {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+0054 u+1EA1 u+0069 u+0073 u+0061 u+006F u+0068 u+1ECD u+006B u+0068 u+00F4 u+006E u+0067 u+0074 u+0068 u+1EC3 u+0063 u+0068 u+1EC9 u+006E u+00F3 u+0069 u+0074 u+0069 u+1EBF u+006E u+0067 u+0056 u+0069 u+1EC7 u+0074 }]] ""] } TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g test http-idna-2.14-L {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F }]] ""] } 3B-ww4c5e180e575a65lsy2b test http-idna-2.14-M {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074 u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D u+004F u+004E u+004B u+0045 u+0059 u+0053 }]] ""] } -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n test http-idna-2.14-N {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D u+305D u+308C u+305E u+308C u+306E u+5834 u+6240 }]] ""] } Hello-Another-Way--fc4qua05auwb3674vfr0b test http-idna-2.14-O {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032 }]] ""] } 2-u9tlzr9756bt3uc0v test http-idna-2.14-P {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059 u+308B u+0035 u+79D2 u+524D }]] ""] } MajiKoi5-783gue6qz075azm5e test http-idna-2.14-Q {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0 }]] ""] } de-jg4avhby1noc0d test http-idna-2.14-R {puny encode: examples from RFC 3492} { ::http::idna puny encode [join [subst [string map {u+ \\u} { u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067 }]] ""] } d9juau41awczczp test http-idna-2.14-S {puny encode: examples from RFC 3492} { ::http::idna puny encode {-> $1.00 <-} } {-> $1.00 <--} test http-idna-3.1 {puny decode: functional test} { ::http::idna puny decode abc- } abc test http-idna-3.2 {puny decode: functional test} { ::http::idna puny decode abc-k50ab } a\u20acb\u20acc test http-idna-3.3 {puny decode: functional test} { ::http::idna puny decode ABC- } ABC test http-idna-3.4 {puny decode: functional test} { ::http::idna puny decode ABC-k50ab } A\u20ACB\u20ACC test http-idna-3.5 {puny decode: functional test} { ::http::idna puny decode ABC-K50AB } A\u20ACB\u20ACC test http-idna-3.6 {puny decode: functional test} { ::http::idna puny decode abc-K50AB } a\u20ACb\u20ACc test http-idna-3.7 {puny decode: functional test} { ::http::idna puny decode ABC- 0 } abc test http-idna-3.8 {puny decode: functional test} { ::http::idna puny decode ABC-K50AB 0 } a\u20ACb\u20ACc test http-idna-3.9 {puny decode: functional test} { ::http::idna puny decode ABC- 1 } ABC test http-idna-3.10 {puny decode: functional test} { ::http::idna puny decode ABC-K50AB 1 } A\u20ACB\u20ACC test http-idna-3.11 {puny decode: functional test} { ::http::idna puny decode abc- 0 } abc test http-idna-3.12 {puny decode: functional test} { ::http::idna puny decode abc-k50ab 0 } a\u20ACb\u20ACc test http-idna-3.13 {puny decode: functional test} { ::http::idna puny decode abc- 1 } ABC test http-idna-3.14 {puny decode: functional test} { ::http::idna puny decode abc-k50ab 1 } A\u20ACB\u20ACC test http-idna-3.15 {puny decode: edge cases and errors} { # Is this case actually correct? binary encode hex [encoding convertto utf-8 [::http::idna puny decode abc]] } c282c281c280 test http-idna-3.16 {puny decode: edge cases and errors} -returnCodes error -body { ::http::idna puny decode abc! } -result {bad decode character "!"} test http-idna-3.17 {puny decode: edge cases and errors} { catch {::http::idna puny decode abc!} -> opt dict get $opt -errorcode } {PUNYCODE BAD_INPUT CHAR} test http-idna-3.18 {puny decode: edge cases and errors} { ::http::idna puny decode "" } {} # A helper so we don't get lots of crap in failures proc hexify s {lmap c [split $s ""] {format u+%04X [scan $c %c]}} test http-idna-3.19-A {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode egbpdaj6bu4bxfgehfvwxn] } [list {*}{ u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644 u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F }] test http-idna-3.19-B {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode ihqwcrb4cv8a8dqg056pqjye] } {u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587} test http-idna-3.19-C {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode ihqwctvzc91f659drss3x8bo0yb] } {u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587} test http-idna-3.19-D {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode Proprostnemluvesky-uyb24dma41a] } [list {*}{ u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074 u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D u+0065 u+0073 u+006B u+0079 }] test http-idna-3.19-E {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode 4dbcagdahymbxekheh6e0a7fei0b] } [list {*}{ u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8 u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2 u+05D1 u+05E8 u+05D9 u+05EA }] test http-idna-3.19-F {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode \ i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd] } [list {*}{ u+092F u+0939 u+0932 u+094B u+0917 u+0939 u+093F u+0928 u+094D u+0926 u+0940 u+0915 u+094D u+092F u+094B u+0902 u+0928 u+0939 u+0940 u+0902 u+092C u+094B u+0932 u+0938 u+0915 u+0924 u+0947 u+0939 u+0948 u+0902 }] test http-idna-3.19-G {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa] } [list {*}{ u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092 u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B }] test http-idna-3.19-H {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode \ 989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c] } [list {*}{ u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774 u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74 u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C }] test http-idna-3.19-I {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode b1abfaaepdrnnbgefbadotcwatmq2g4l] } [list {*}{ u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E u+043D u+0438 u+043D u+0435 u+0433 u+043E u+0432 u+043E u+0440 u+044F u+0442 u+043F u+043E u+0440 u+0443 u+0441 u+0441 u+043A u+0438 }] test http-idna-3.19-J {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode \ PorqunopuedensimplementehablarenEspaol-fmd56a] } [list {*}{ u+0050 u+006F u+0072 u+0071 u+0075 u+00E9 u+006E u+006F u+0070 u+0075 u+0065 u+0064 u+0065 u+006E u+0073 u+0069 u+006D u+0070 u+006C u+0065 u+006D u+0065 u+006E u+0074 u+0065 u+0068 u+0061 u+0062 u+006C u+0061 u+0072 u+0065 u+006E u+0045 u+0073 u+0070 u+0061 u+00F1 u+006F u+006C }] test http-idna-3.19-K {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode \ TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g] } [list {*}{ u+0054 u+1EA1 u+0069 u+0073 u+0061 u+006F u+0068 u+1ECD u+006B u+0068 u+00F4 u+006E u+0067 u+0074 u+0068 u+1EC3 u+0063 u+0068 u+1EC9 u+006E u+00F3 u+0069 u+0074 u+0069 u+1EBF u+006E u+0067 u+0056 u+0069 u+1EC7 u+0074 }] test http-idna-3.19-L {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode 3B-ww4c5e180e575a65lsy2b] } {u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F} test http-idna-3.19-M {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n] } [list {*}{ u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074 u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D u+004F u+004E u+004B u+0045 u+0059 u+0053 }] test http-idna-3.19-N {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode Hello-Another-Way--fc4qua05auwb3674vfr0b] } [list {*}{ u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D u+305D u+308C u+305E u+308C u+306E u+5834 u+6240 }] test http-idna-3.19-O {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode 2-u9tlzr9756bt3uc0v] } {u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032} test http-idna-3.19-P {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode MajiKoi5-783gue6qz075azm5e] } [list {*}{ u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059 u+308B u+0035 u+79D2 u+524D }] test http-idna-3.19-Q {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode de-jg4avhby1noc0d] } {u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0} test http-idna-3.19-R {puny decode: examples from RFC 3492} { hexify [::http::idna puny decode d9juau41awczczp] } {u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067} test http-idna-3.19-S {puny decode: examples from RFC 3492} { ::http::idna puny decode {-> $1.00 <--} } {-> $1.00 <-} rename hexify "" test http-idna-4.1 {IDNA encoding} { ::http::idna encode abc.def } abc.def test http-idna-4.2 {IDNA encoding} { ::http::idna encode a\u20acb\u20acc.def } xn--abc-k50ab.def test http-idna-4.3 {IDNA encoding} { ::http::idna encode def.a\u20acb\u20acc } def.xn--abc-k50ab test http-idna-4.4 {IDNA encoding} { ::http::idna encode ABC.DEF } ABC.DEF test http-idna-4.5 {IDNA encoding} { ::http::idna encode A\u20acB\u20acC.def } xn--ABC-k50ab.def test http-idna-4.6 {IDNA encoding: invalid edge case} { # Should this be an error? ::http::idna encode abc..def } abc..def test http-idna-4.7 {IDNA encoding: invalid char} -returnCodes error -body { ::http::idna encode abc.$.def } -result {bad character "$" in DNS name} test http-idna-4.7.1 {IDNA encoding: invalid char} { catch {::http::idna encode abc.$.def} -> opt dict get $opt -errorcode } {IDNA INVALID_NAME_CHARACTER {$}} test http-idna-4.8 {IDNA encoding: empty} { ::http::idna encode "" } {} set overlong www.[join [subst [string map {u+ \\u} { u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774 u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74 u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C }]] ""].com test http-idna-4.9 {IDNA encoding: max lengths from RFC 5890} -body { ::http::idna encode $overlong } -returnCodes error -result "hostname part too long" test http-idna-4.9.1 {IDNA encoding: max lengths from RFC 5890} { catch {::http::idna encode $overlong} -> opt dict get $opt -errorcode } {IDNA OVERLONG_PART xn--989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c} unset overlong test http-idna-4.10 {IDNA encoding: edge cases} { ::http::idna encode pass\u00e9.example.com } xn--pass-epa.example.com test http-idna-5.1 {IDNA decoding} { ::http::idna decode abc.def } abc.def test http-idna-5.2 {IDNA decoding} { # Invalid entry that's just a wrapper ::http::idna decode xn--abc-.def } abc.def test http-idna-5.3 {IDNA decoding} { # Invalid entry that's just a wrapper ::http::idna decode xn--abc-.xn--def- } abc.def test http-idna-5.4 {IDNA decoding} { # Invalid entry that's just a wrapper ::http::idna decode XN--abc-.XN--def- } abc.def test http-idna-5.5 {IDNA decoding: error cases} -returnCodes error -body { ::http::idna decode xn--$$$.example.com } -result {bad decode character "$"} test http-idna-5.5.1 {IDNA decoding: error cases} { catch {::http::idna decode xn--$$$.example.com} -> opt dict get $opt -errorcode } {PUNYCODE BAD_INPUT CHAR} test http-idna-5.6 {IDNA decoding: error cases} -returnCodes error -body { ::http::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def } -result {exceeded input data} test http-idna-5.6.1 {IDNA decoding: error cases} { catch {::http::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def} -> opt dict get $opt -errorcode } {PUNYCODE BAD_INPUT LENGTH} # cleanup catch {unset url} catch {unset badurl} catch {unset port} |
︙ | ︙ |
Changes to unix/Makefile.in.
︙ | ︙ | |||
1010 1011 1012 1013 1014 1015 1016 | install-libraries: libraries @for i in "$(SCRIPT_INSTALL_DIR)"; do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done | | > > > > > > > > | 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 | install-libraries: libraries @for i in "$(SCRIPT_INSTALL_DIR)"; do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done @for i in opt0.4 encoding ../tcl8 ../tcl8/8.4 ../tcl8/8.4/platform ../tcl8/8.5 ../tcl8/8.6 ../tcl8/8.7 ../tcl8/8.7/http; do \ if [ ! -d "$(SCRIPT_INSTALL_DIR)"/$$i ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/$$i; \ fi; \ done @echo "Installing library files to $(SCRIPT_INSTALL_DIR)/" @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \ $(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@ ; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done @echo "Installing package http 2.9.1 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.6/http-2.9.1.tm @echo "Installing package cookiejar 0.1.0 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/http/cookiejar.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.7/cookiejar-0.1.0.tm @$(INSTALL_DATA) $(TOP_DIR)/library/http/effective_tld_names.txt.gz \ "$(MODULE_INSTALL_DIR)"/tcl8/8.7/http/effective_tld_names.txt.gz @echo "Installing package http::idna 1.0.0 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/http/idna.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.7/http/idna-1.0.0.tm @echo "Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/" @for i in $(TOP_DIR)/library/opt/*.tcl; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \ done @echo "Installing package msgcat 1.7.0 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.7/msgcat-1.7.0.tm |
︙ | ︙ |