ires 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -45
- data/ext/Gopkg.lock +31 -1
- data/ext/ires/image.go +227 -0
- data/ext/ires/ires.go +47 -59
- data/ext/ires/uri.go +143 -0
- data/ext/main.go +18 -9
- data/ext/vendor/github.com/PuerkitoBio/purell/LICENSE +12 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/README.md +187 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/bench_test.go +57 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/benchmarks/v0.1.0 +9 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/example_test.go +35 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/purell.go +379 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/purell_test.go +768 -0
- data/ext/vendor/github.com/PuerkitoBio/purell/urlnorm_test.go +53 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/LICENSE +27 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/README.md +16 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/urlesc.go +180 -0
- data/ext/vendor/github.com/PuerkitoBio/urlesc/urlesc_test.go +641 -0
- data/ext/vendor/github.com/{satori/go.uuid → goware/urlx}/LICENSE +3 -1
- data/ext/vendor/github.com/goware/urlx/README.md +172 -0
- data/ext/vendor/github.com/goware/urlx/urlx.go +196 -0
- data/ext/vendor/github.com/goware/urlx/urlx_test.go +232 -0
- data/ext/vendor/golang.org/x/net/AUTHORS +3 -0
- data/ext/vendor/golang.org/x/net/CONTRIBUTING.md +31 -0
- data/ext/vendor/golang.org/x/net/CONTRIBUTORS +3 -0
- data/ext/vendor/golang.org/x/net/LICENSE +27 -0
- data/ext/vendor/golang.org/x/net/PATENTS +22 -0
- data/ext/vendor/golang.org/x/net/README.md +16 -0
- data/ext/vendor/golang.org/x/net/bpf/asm.go +41 -0
- data/ext/vendor/golang.org/x/net/bpf/constants.go +218 -0
- data/ext/vendor/golang.org/x/net/bpf/doc.go +82 -0
- data/ext/vendor/golang.org/x/net/bpf/instructions.go +704 -0
- data/ext/vendor/golang.org/x/net/bpf/instructions_test.go +525 -0
- data/ext/vendor/golang.org/x/net/bpf/setter.go +10 -0
- data/ext/vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf +1 -0
- data/ext/vendor/golang.org/x/net/bpf/testdata/all_instructions.txt +79 -0
- data/ext/vendor/golang.org/x/net/bpf/vm.go +140 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_aluop_test.go +512 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_bpf_test.go +192 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_extension_test.go +49 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_instructions.go +174 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_jump_test.go +380 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_load_test.go +246 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_ret_test.go +115 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_scratch_test.go +247 -0
- data/ext/vendor/golang.org/x/net/bpf/vm_test.go +144 -0
- data/ext/vendor/golang.org/x/net/codereview.cfg +1 -0
- data/ext/vendor/golang.org/x/net/context/context.go +54 -0
- data/ext/vendor/golang.org/x/net/context/context_test.go +583 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +74 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go +29 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go +147 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17_test.go +79 -0
- data/ext/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go +105 -0
- data/ext/vendor/golang.org/x/net/context/go17.go +72 -0
- data/ext/vendor/golang.org/x/net/context/go19.go +20 -0
- data/ext/vendor/golang.org/x/net/context/pre_go17.go +300 -0
- data/ext/vendor/golang.org/x/net/context/pre_go19.go +109 -0
- data/ext/vendor/golang.org/x/net/context/withtimeout_test.go +31 -0
- data/ext/vendor/golang.org/x/net/dict/dict.go +210 -0
- data/ext/vendor/golang.org/x/net/dns/dnsmessage/example_test.go +132 -0
- data/ext/vendor/golang.org/x/net/dns/dnsmessage/message.go +1997 -0
- data/ext/vendor/golang.org/x/net/dns/dnsmessage/message_test.go +1116 -0
- data/ext/vendor/golang.org/x/net/html/atom/atom.go +78 -0
- data/ext/vendor/golang.org/x/net/html/atom/atom_test.go +109 -0
- data/ext/vendor/golang.org/x/net/html/atom/gen.go +709 -0
- data/ext/vendor/golang.org/x/net/html/atom/table.go +777 -0
- data/ext/vendor/golang.org/x/net/html/atom/table_test.go +373 -0
- data/ext/vendor/golang.org/x/net/html/charset/charset.go +257 -0
- data/ext/vendor/golang.org/x/net/html/charset/charset_test.go +237 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html +49 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html +49 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html +47 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/README +9 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html +0 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html +0 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html +49 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html +48 -0
- data/ext/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html +48 -0
- data/ext/vendor/golang.org/x/net/html/const.go +104 -0
- data/ext/vendor/golang.org/x/net/html/doc.go +106 -0
- data/ext/vendor/golang.org/x/net/html/doctype.go +156 -0
- data/ext/vendor/golang.org/x/net/html/entity.go +2253 -0
- data/ext/vendor/golang.org/x/net/html/entity_test.go +29 -0
- data/ext/vendor/golang.org/x/net/html/escape.go +258 -0
- data/ext/vendor/golang.org/x/net/html/escape_test.go +97 -0
- data/ext/vendor/golang.org/x/net/html/example_test.go +40 -0
- data/ext/vendor/golang.org/x/net/html/foreign.go +226 -0
- data/ext/vendor/golang.org/x/net/html/node.go +193 -0
- data/ext/vendor/golang.org/x/net/html/node_test.go +146 -0
- data/ext/vendor/golang.org/x/net/html/parse.go +2094 -0
- data/ext/vendor/golang.org/x/net/html/parse_test.go +388 -0
- data/ext/vendor/golang.org/x/net/html/render.go +271 -0
- data/ext/vendor/golang.org/x/net/html/render_test.go +156 -0
- data/ext/vendor/golang.org/x/net/html/testdata/go1.html +2237 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/README +28 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/adoption01.dat +194 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat +31 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/comments01.dat +135 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/doctype01.dat +370 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/entities01.dat +603 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/entities02.dat +249 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/html5test-com.dat +246 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/inbody01.dat +43 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/isindex.dat +40 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat +0 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/pending-spec-changes.dat +52 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/plain-text-unsafe.dat +0 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/scriptdata01.dat +308 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/scripted/adoption01.dat +15 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/scripted/webkit01.dat +28 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tables01.dat +212 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests1.dat +1952 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests10.dat +799 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests11.dat +482 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests12.dat +62 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests14.dat +74 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests15.dat +208 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests16.dat +2299 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests17.dat +153 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests18.dat +269 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests19.dat +1237 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests2.dat +763 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests20.dat +455 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests21.dat +221 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests22.dat +157 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests23.dat +155 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests24.dat +79 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests25.dat +219 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests26.dat +313 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests3.dat +305 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests4.dat +59 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests5.dat +191 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests6.dat +663 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests7.dat +390 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests8.dat +148 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests9.dat +457 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tests_innerHTML_1.dat +741 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/tricky01.dat +261 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/webkit01.dat +610 -0
- data/ext/vendor/golang.org/x/net/html/testdata/webkit/webkit02.dat +159 -0
- data/ext/vendor/golang.org/x/net/html/token.go +1219 -0
- data/ext/vendor/golang.org/x/net/html/token_test.go +748 -0
- data/ext/vendor/golang.org/x/net/http2/Dockerfile +51 -0
- data/ext/vendor/golang.org/x/net/http2/Makefile +3 -0
- data/ext/vendor/golang.org/x/net/http2/README +20 -0
- data/ext/vendor/golang.org/x/net/http2/ciphers.go +641 -0
- data/ext/vendor/golang.org/x/net/http2/ciphers_test.go +309 -0
- data/ext/vendor/golang.org/x/net/http2/client_conn_pool.go +256 -0
- data/ext/vendor/golang.org/x/net/http2/configure_transport.go +80 -0
- data/ext/vendor/golang.org/x/net/http2/databuffer.go +146 -0
- data/ext/vendor/golang.org/x/net/http2/databuffer_test.go +157 -0
- data/ext/vendor/golang.org/x/net/http2/errors.go +133 -0
- data/ext/vendor/golang.org/x/net/http2/errors_test.go +24 -0
- data/ext/vendor/golang.org/x/net/http2/flow.go +50 -0
- data/ext/vendor/golang.org/x/net/http2/flow_test.go +53 -0
- data/ext/vendor/golang.org/x/net/http2/frame.go +1579 -0
- data/ext/vendor/golang.org/x/net/http2/frame_test.go +1191 -0
- data/ext/vendor/golang.org/x/net/http2/go16.go +16 -0
- data/ext/vendor/golang.org/x/net/http2/go17.go +106 -0
- data/ext/vendor/golang.org/x/net/http2/go17_not18.go +36 -0
- data/ext/vendor/golang.org/x/net/http2/go18.go +56 -0
- data/ext/vendor/golang.org/x/net/http2/go18_test.go +79 -0
- data/ext/vendor/golang.org/x/net/http2/go19.go +16 -0
- data/ext/vendor/golang.org/x/net/http2/go19_test.go +60 -0
- data/ext/vendor/golang.org/x/net/http2/gotrack.go +170 -0
- data/ext/vendor/golang.org/x/net/http2/gotrack_test.go +33 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/Makefile +8 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/README +16 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/h2demo.go +538 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/launch.go +302 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/rootCA.key +27 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/rootCA.pem +26 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/rootCA.srl +1 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/server.crt +20 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/server.key +27 -0
- data/ext/vendor/golang.org/x/net/http2/h2demo/tmpl.go +1991 -0
- data/ext/vendor/golang.org/x/net/http2/h2i/README.md +97 -0
- data/ext/vendor/golang.org/x/net/http2/h2i/h2i.go +522 -0
- data/ext/vendor/golang.org/x/net/http2/headermap.go +78 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/encode.go +240 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/encode_test.go +386 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/hpack.go +490 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/hpack_test.go +722 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/huffman.go +212 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/tables.go +479 -0
- data/ext/vendor/golang.org/x/net/http2/hpack/tables_test.go +214 -0
- data/ext/vendor/golang.org/x/net/http2/http2.go +391 -0
- data/ext/vendor/golang.org/x/net/http2/http2_test.go +199 -0
- data/ext/vendor/golang.org/x/net/http2/not_go16.go +21 -0
- data/ext/vendor/golang.org/x/net/http2/not_go17.go +87 -0
- data/ext/vendor/golang.org/x/net/http2/not_go18.go +29 -0
- data/ext/vendor/golang.org/x/net/http2/not_go19.go +16 -0
- data/ext/vendor/golang.org/x/net/http2/pipe.go +163 -0
- data/ext/vendor/golang.org/x/net/http2/pipe_test.go +130 -0
- data/ext/vendor/golang.org/x/net/http2/server.go +2857 -0
- data/ext/vendor/golang.org/x/net/http2/server_push_test.go +521 -0
- data/ext/vendor/golang.org/x/net/http2/server_test.go +3721 -0
- data/ext/vendor/golang.org/x/net/http2/testdata/draft-ietf-httpbis-http2.xml +5021 -0
- data/ext/vendor/golang.org/x/net/http2/transport.go +2285 -0
- data/ext/vendor/golang.org/x/net/http2/transport_test.go +3714 -0
- data/ext/vendor/golang.org/x/net/http2/write.go +370 -0
- data/ext/vendor/golang.org/x/net/http2/writesched.go +242 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_priority.go +452 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_priority_test.go +541 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_random.go +72 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_random_test.go +44 -0
- data/ext/vendor/golang.org/x/net/http2/writesched_test.go +125 -0
- data/ext/vendor/golang.org/x/net/http2/z_spec_test.go +356 -0
- data/ext/vendor/golang.org/x/net/icmp/dstunreach.go +41 -0
- data/ext/vendor/golang.org/x/net/icmp/echo.go +45 -0
- data/ext/vendor/golang.org/x/net/icmp/endpoint.go +113 -0
- data/ext/vendor/golang.org/x/net/icmp/example_test.go +63 -0
- data/ext/vendor/golang.org/x/net/icmp/extension.go +89 -0
- data/ext/vendor/golang.org/x/net/icmp/extension_test.go +259 -0
- data/ext/vendor/golang.org/x/net/icmp/helper_posix.go +75 -0
- data/ext/vendor/golang.org/x/net/icmp/interface.go +236 -0
- data/ext/vendor/golang.org/x/net/icmp/ipv4.go +61 -0
- data/ext/vendor/golang.org/x/net/icmp/ipv4_test.go +83 -0
- data/ext/vendor/golang.org/x/net/icmp/ipv6.go +23 -0
- data/ext/vendor/golang.org/x/net/icmp/listen_posix.go +100 -0
- data/ext/vendor/golang.org/x/net/icmp/listen_stub.go +33 -0
- data/ext/vendor/golang.org/x/net/icmp/message.go +152 -0
- data/ext/vendor/golang.org/x/net/icmp/message_test.go +134 -0
- data/ext/vendor/golang.org/x/net/icmp/messagebody.go +41 -0
- data/ext/vendor/golang.org/x/net/icmp/mpls.go +77 -0
- data/ext/vendor/golang.org/x/net/icmp/multipart.go +109 -0
- data/ext/vendor/golang.org/x/net/icmp/multipart_test.go +442 -0
- data/ext/vendor/golang.org/x/net/icmp/packettoobig.go +43 -0
- data/ext/vendor/golang.org/x/net/icmp/paramprob.go +63 -0
- data/ext/vendor/golang.org/x/net/icmp/ping_test.go +200 -0
- data/ext/vendor/golang.org/x/net/icmp/sys_freebsd.go +11 -0
- data/ext/vendor/golang.org/x/net/icmp/timeexceeded.go +39 -0
- data/ext/vendor/golang.org/x/net/idna/example_test.go +70 -0
- data/ext/vendor/golang.org/x/net/idna/idna.go +680 -0
- data/ext/vendor/golang.org/x/net/idna/idna_test.go +108 -0
- data/ext/vendor/golang.org/x/net/idna/punycode.go +203 -0
- data/ext/vendor/golang.org/x/net/idna/punycode_test.go +198 -0
- data/ext/vendor/golang.org/x/net/idna/tables.go +4477 -0
- data/ext/vendor/golang.org/x/net/idna/trie.go +72 -0
- data/ext/vendor/golang.org/x/net/idna/trieval.go +114 -0
- data/ext/vendor/golang.org/x/net/internal/iana/const.go +180 -0
- data/ext/vendor/golang.org/x/net/internal/iana/gen.go +293 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_bsd.go +53 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_nobsd.go +15 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_posix.go +31 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_stub.go +32 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_unix.go +29 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/helper_windows.go +42 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/interface.go +94 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/rlimit.go +11 -0
- data/ext/vendor/golang.org/x/net/internal/nettest/stack.go +147 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr.go +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go +13 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go +17 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_darwin.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_freebsd.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_linux.go +49 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_netbsd.go +47 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_openbsd.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/defs_solaris.go +44 -0
- data/ext/vendor/golang.org/x/net/internal/socket/error_unix.go +31 -0
- data/ext/vendor/golang.org/x/net/internal/socket/error_windows.go +26 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_32bit.go +19 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_64bit.go +19 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go +19 -0
- data/ext/vendor/golang.org/x/net/internal/socket/iovec_stub.go +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go +42 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go +39 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go +16 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_linux.go +36 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go +24 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go +24 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go +36 -0
- data/ext/vendor/golang.org/x/net/internal/socket/msghdr_stub.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go +74 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_msg.go +77 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go +18 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go +18 -0
- data/ext/vendor/golang.org/x/net/internal/socket/rawconn_stub.go +25 -0
- data/ext/vendor/golang.org/x/net/internal/socket/reflect.go +62 -0
- data/ext/vendor/golang.org/x/net/internal/socket/socket.go +285 -0
- data/ext/vendor/golang.org/x/net/internal/socket/socket_go1_9_test.go +259 -0
- data/ext/vendor/golang.org/x/net/internal/socket/socket_test.go +46 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys.go +33 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_bsd.go +17 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_bsdvar.go +14 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_darwin.go +7 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_dragonfly.go +7 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux.go +27 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_386.go +55 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_386.s +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go +10 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go +55 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_netbsd.go +25 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_posix.go +168 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_solaris.go +71 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_solaris_amd64.s +11 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_stub.go +64 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_unix.go +33 -0
- data/ext/vendor/golang.org/x/net/internal/socket/sys_windows.go +70 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go +63 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go +66 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go +65 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go +68 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go +61 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go +59 -0
- data/ext/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go +60 -0
- data/ext/vendor/golang.org/x/net/internal/timeseries/timeseries.go +525 -0
- data/ext/vendor/golang.org/x/net/internal/timeseries/timeseries_test.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv4/batch.go +191 -0
- data/ext/vendor/golang.org/x/net/ipv4/bpf_test.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv4/control.go +144 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_bsd.go +40 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_pktinfo.go +39 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_test.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_unix.go +73 -0
- data/ext/vendor/golang.org/x/net/ipv4/control_windows.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_darwin.go +77 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_dragonfly.go +38 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_freebsd.go +75 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_linux.go +122 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_netbsd.go +37 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_openbsd.go +37 -0
- data/ext/vendor/golang.org/x/net/ipv4/defs_solaris.go +84 -0
- data/ext/vendor/golang.org/x/net/ipv4/dgramopt.go +265 -0
- data/ext/vendor/golang.org/x/net/ipv4/doc.go +244 -0
- data/ext/vendor/golang.org/x/net/ipv4/endpoint.go +187 -0
- data/ext/vendor/golang.org/x/net/ipv4/example_test.go +224 -0
- data/ext/vendor/golang.org/x/net/ipv4/gen.go +199 -0
- data/ext/vendor/golang.org/x/net/ipv4/genericopt.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv4/header.go +159 -0
- data/ext/vendor/golang.org/x/net/ipv4/header_test.go +228 -0
- data/ext/vendor/golang.org/x/net/ipv4/helper.go +63 -0
- data/ext/vendor/golang.org/x/net/ipv4/iana.go +34 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp_linux.go +25 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp_stub.go +25 -0
- data/ext/vendor/golang.org/x/net/ipv4/icmp_test.go +95 -0
- data/ext/vendor/golang.org/x/net/ipv4/multicast_test.go +334 -0
- data/ext/vendor/golang.org/x/net/ipv4/multicastlistener_test.go +265 -0
- data/ext/vendor/golang.org/x/net/ipv4/multicastsockopt_test.go +195 -0
- data/ext/vendor/golang.org/x/net/ipv4/packet.go +69 -0
- data/ext/vendor/golang.org/x/net/ipv4/packet_go1_8.go +56 -0
- data/ext/vendor/golang.org/x/net/ipv4/packet_go1_9.go +67 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_cmsg.go +36 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_cmsg_go1_8.go +59 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_cmsg_go1_9.go +67 -0
- data/ext/vendor/golang.org/x/net/ipv4/payload_nocmsg.go +42 -0
- data/ext/vendor/golang.org/x/net/ipv4/readwrite_go1_8_test.go +248 -0
- data/ext/vendor/golang.org/x/net/ipv4/readwrite_go1_9_test.go +388 -0
- data/ext/vendor/golang.org/x/net/ipv4/readwrite_test.go +140 -0
- data/ext/vendor/golang.org/x/net/ipv4/sockopt.go +44 -0
- data/ext/vendor/golang.org/x/net/ipv4/sockopt_posix.go +71 -0
- data/ext/vendor/golang.org/x/net/ipv4/sockopt_stub.go +42 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreq.go +119 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go +25 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreqn.go +42 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_bpf.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_bsd.go +37 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_darwin.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_dragonfly.go +35 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_freebsd.go +76 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_linux.go +59 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_solaris.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_ssmreq.go +54 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv4/sys_windows.go +67 -0
- data/ext/vendor/golang.org/x/net/ipv4/unicast_test.go +247 -0
- data/ext/vendor/golang.org/x/net/ipv4/unicastsockopt_test.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_darwin.go +99 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go +31 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go +95 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go +95 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_386.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go +150 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_netbsd.go +30 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_openbsd.go +30 -0
- data/ext/vendor/golang.org/x/net/ipv4/zsys_solaris.go +100 -0
- data/ext/vendor/golang.org/x/net/ipv6/batch.go +119 -0
- data/ext/vendor/golang.org/x/net/ipv6/bpf_test.go +96 -0
- data/ext/vendor/golang.org/x/net/ipv6/control.go +187 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go +48 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go +94 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_test.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_unix.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/control_windows.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_darwin.go +112 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_dragonfly.go +84 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_freebsd.go +105 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_linux.go +147 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_netbsd.go +80 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_openbsd.go +89 -0
- data/ext/vendor/golang.org/x/net/ipv6/defs_solaris.go +114 -0
- data/ext/vendor/golang.org/x/net/ipv6/dgramopt.go +302 -0
- data/ext/vendor/golang.org/x/net/ipv6/doc.go +243 -0
- data/ext/vendor/golang.org/x/net/ipv6/endpoint.go +128 -0
- data/ext/vendor/golang.org/x/net/ipv6/example_test.go +216 -0
- data/ext/vendor/golang.org/x/net/ipv6/gen.go +199 -0
- data/ext/vendor/golang.org/x/net/ipv6/genericopt.go +58 -0
- data/ext/vendor/golang.org/x/net/ipv6/header.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/header_test.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/helper.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv6/iana.go +82 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp.go +60 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_bsd.go +29 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_linux.go +27 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_solaris.go +27 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_stub.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_test.go +96 -0
- data/ext/vendor/golang.org/x/net/ipv6/icmp_windows.go +22 -0
- data/ext/vendor/golang.org/x/net/ipv6/mocktransponder_test.go +32 -0
- data/ext/vendor/golang.org/x/net/ipv6/multicast_test.go +264 -0
- data/ext/vendor/golang.org/x/net/ipv6/multicastlistener_test.go +261 -0
- data/ext/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go +157 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_cmsg.go +35 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_cmsg_go1_8.go +55 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_cmsg_go1_9.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv6/payload_nocmsg.go +41 -0
- data/ext/vendor/golang.org/x/net/ipv6/readwrite_go1_8_test.go +242 -0
- data/ext/vendor/golang.org/x/net/ipv6/readwrite_go1_9_test.go +373 -0
- data/ext/vendor/golang.org/x/net/ipv6/readwrite_test.go +148 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt.go +43 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt_posix.go +87 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt_stub.go +46 -0
- data/ext/vendor/golang.org/x/net/ipv6/sockopt_test.go +133 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_asmreq.go +24 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go +17 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_bpf.go +23 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go +16 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_bsd.go +57 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_darwin.go +106 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_freebsd.go +92 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_linux.go +74 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_solaris.go +74 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_ssmreq.go +54 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go +21 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_stub.go +13 -0
- data/ext/vendor/golang.org/x/net/ipv6/sys_windows.go +75 -0
- data/ext/vendor/golang.org/x/net/ipv6/unicast_test.go +184 -0
- data/ext/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go +120 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_darwin.go +131 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go +88 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go +122 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go +124 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go +124 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_386.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go +170 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go +172 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_netbsd.go +84 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_openbsd.go +93 -0
- data/ext/vendor/golang.org/x/net/ipv6/zsys_solaris.go +131 -0
- data/ext/vendor/golang.org/x/net/lex/httplex/httplex.go +351 -0
- data/ext/vendor/golang.org/x/net/lex/httplex/httplex_test.go +119 -0
- data/ext/vendor/golang.org/x/net/lif/address.go +105 -0
- data/ext/vendor/golang.org/x/net/lif/address_test.go +123 -0
- data/ext/vendor/golang.org/x/net/lif/binary.go +115 -0
- data/ext/vendor/golang.org/x/net/lif/defs_solaris.go +90 -0
- data/ext/vendor/golang.org/x/net/lif/lif.go +43 -0
- data/ext/vendor/golang.org/x/net/lif/link.go +126 -0
- data/ext/vendor/golang.org/x/net/lif/link_test.go +63 -0
- data/ext/vendor/golang.org/x/net/lif/sys.go +21 -0
- data/ext/vendor/golang.org/x/net/lif/sys_solaris_amd64.s +8 -0
- data/ext/vendor/golang.org/x/net/lif/syscall.go +28 -0
- data/ext/vendor/golang.org/x/net/lif/zsys_solaris_amd64.go +103 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest.go +456 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest_go16.go +24 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest_go17.go +24 -0
- data/ext/vendor/golang.org/x/net/nettest/conntest_test.go +76 -0
- data/ext/vendor/golang.org/x/net/netutil/listen.go +48 -0
- data/ext/vendor/golang.org/x/net/netutil/listen_test.go +101 -0
- data/ext/vendor/golang.org/x/net/proxy/direct.go +18 -0
- data/ext/vendor/golang.org/x/net/proxy/per_host.go +140 -0
- data/ext/vendor/golang.org/x/net/proxy/per_host_test.go +55 -0
- data/ext/vendor/golang.org/x/net/proxy/proxy.go +134 -0
- data/ext/vendor/golang.org/x/net/proxy/proxy_test.go +215 -0
- data/ext/vendor/golang.org/x/net/proxy/socks5.go +214 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/gen.go +713 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/list.go +135 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/list_test.go +416 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/table.go +9419 -0
- data/ext/vendor/golang.org/x/net/publicsuffix/table_test.go +16756 -0
- data/ext/vendor/golang.org/x/net/route/address.go +425 -0
- data/ext/vendor/golang.org/x/net/route/address_darwin_test.go +63 -0
- data/ext/vendor/golang.org/x/net/route/address_test.go +103 -0
- data/ext/vendor/golang.org/x/net/route/binary.go +90 -0
- data/ext/vendor/golang.org/x/net/route/defs_darwin.go +114 -0
- data/ext/vendor/golang.org/x/net/route/defs_dragonfly.go +113 -0
- data/ext/vendor/golang.org/x/net/route/defs_freebsd.go +337 -0
- data/ext/vendor/golang.org/x/net/route/defs_netbsd.go +112 -0
- data/ext/vendor/golang.org/x/net/route/defs_openbsd.go +116 -0
- data/ext/vendor/golang.org/x/net/route/interface.go +64 -0
- data/ext/vendor/golang.org/x/net/route/interface_announce.go +32 -0
- data/ext/vendor/golang.org/x/net/route/interface_classic.go +66 -0
- data/ext/vendor/golang.org/x/net/route/interface_freebsd.go +78 -0
- data/ext/vendor/golang.org/x/net/route/interface_multicast.go +30 -0
- data/ext/vendor/golang.org/x/net/route/interface_openbsd.go +90 -0
- data/ext/vendor/golang.org/x/net/route/message.go +72 -0
- data/ext/vendor/golang.org/x/net/route/message_darwin_test.go +34 -0
- data/ext/vendor/golang.org/x/net/route/message_freebsd_test.go +92 -0
- data/ext/vendor/golang.org/x/net/route/message_test.go +239 -0
- data/ext/vendor/golang.org/x/net/route/route.go +123 -0
- data/ext/vendor/golang.org/x/net/route/route_classic.go +67 -0
- data/ext/vendor/golang.org/x/net/route/route_openbsd.go +65 -0
- data/ext/vendor/golang.org/x/net/route/route_test.go +390 -0
- data/ext/vendor/golang.org/x/net/route/sys.go +39 -0
- data/ext/vendor/golang.org/x/net/route/sys_darwin.go +87 -0
- data/ext/vendor/golang.org/x/net/route/sys_dragonfly.go +76 -0
- data/ext/vendor/golang.org/x/net/route/sys_freebsd.go +155 -0
- data/ext/vendor/golang.org/x/net/route/sys_netbsd.go +71 -0
- data/ext/vendor/golang.org/x/net/route/sys_openbsd.go +80 -0
- data/ext/vendor/golang.org/x/net/route/syscall.go +28 -0
- data/ext/vendor/golang.org/x/net/route/zsys_darwin.go +99 -0
- data/ext/vendor/golang.org/x/net/route/zsys_dragonfly.go +98 -0
- data/ext/vendor/golang.org/x/net/route/zsys_freebsd_386.go +126 -0
- data/ext/vendor/golang.org/x/net/route/zsys_freebsd_amd64.go +123 -0
- data/ext/vendor/golang.org/x/net/route/zsys_freebsd_arm.go +123 -0
- data/ext/vendor/golang.org/x/net/route/zsys_netbsd.go +97 -0
- data/ext/vendor/golang.org/x/net/route/zsys_openbsd.go +101 -0
- data/ext/vendor/golang.org/x/net/trace/events.go +532 -0
- data/ext/vendor/golang.org/x/net/trace/histogram.go +365 -0
- data/ext/vendor/golang.org/x/net/trace/histogram_test.go +325 -0
- data/ext/vendor/golang.org/x/net/trace/trace.go +1082 -0
- data/ext/vendor/golang.org/x/net/trace/trace_go16.go +21 -0
- data/ext/vendor/golang.org/x/net/trace/trace_go17.go +21 -0
- data/ext/vendor/golang.org/x/net/trace/trace_test.go +178 -0
- data/ext/vendor/golang.org/x/net/webdav/file.go +796 -0
- data/ext/vendor/golang.org/x/net/webdav/file_go1.6.go +17 -0
- data/ext/vendor/golang.org/x/net/webdav/file_go1.7.go +16 -0
- data/ext/vendor/golang.org/x/net/webdav/file_test.go +1184 -0
- data/ext/vendor/golang.org/x/net/webdav/if.go +173 -0
- data/ext/vendor/golang.org/x/net/webdav/if_test.go +322 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/README +11 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/atom_test.go +56 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/example_test.go +151 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/marshal.go +1223 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/marshal_test.go +1939 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/read.go +692 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/read_test.go +744 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/typeinfo.go +371 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/xml.go +1998 -0
- data/ext/vendor/golang.org/x/net/webdav/internal/xml/xml_test.go +752 -0
- data/ext/vendor/golang.org/x/net/webdav/litmus_test_server.go +94 -0
- data/ext/vendor/golang.org/x/net/webdav/lock.go +445 -0
- data/ext/vendor/golang.org/x/net/webdav/lock_test.go +731 -0
- data/ext/vendor/golang.org/x/net/webdav/prop.go +418 -0
- data/ext/vendor/golang.org/x/net/webdav/prop_test.go +613 -0
- data/ext/vendor/golang.org/x/net/webdav/webdav.go +702 -0
- data/ext/vendor/golang.org/x/net/webdav/webdav_test.go +344 -0
- data/ext/vendor/golang.org/x/net/webdav/xml.go +519 -0
- data/ext/vendor/golang.org/x/net/webdav/xml_test.go +906 -0
- data/ext/vendor/golang.org/x/net/websocket/client.go +106 -0
- data/ext/vendor/golang.org/x/net/websocket/dial.go +24 -0
- data/ext/vendor/golang.org/x/net/websocket/dial_test.go +43 -0
- data/ext/vendor/golang.org/x/net/websocket/exampledial_test.go +31 -0
- data/ext/vendor/golang.org/x/net/websocket/examplehandler_test.go +26 -0
- data/ext/vendor/golang.org/x/net/websocket/hybi.go +583 -0
- data/ext/vendor/golang.org/x/net/websocket/hybi_test.go +608 -0
- data/ext/vendor/golang.org/x/net/websocket/server.go +113 -0
- data/ext/vendor/golang.org/x/net/websocket/websocket.go +448 -0
- data/ext/vendor/golang.org/x/net/websocket/websocket_test.go +665 -0
- data/ext/vendor/golang.org/x/net/xsrftoken/xsrf.go +94 -0
- data/ext/vendor/golang.org/x/net/xsrftoken/xsrf_test.go +83 -0
- data/ext/vendor/golang.org/x/text/AUTHORS +3 -0
- data/ext/vendor/golang.org/x/text/CONTRIBUTING.md +31 -0
- data/ext/vendor/golang.org/x/text/CONTRIBUTORS +3 -0
- data/ext/vendor/golang.org/x/text/LICENSE +27 -0
- data/ext/vendor/golang.org/x/text/PATENTS +22 -0
- data/ext/vendor/golang.org/x/text/README.md +91 -0
- data/ext/vendor/golang.org/x/text/cases/cases.go +162 -0
- data/ext/vendor/golang.org/x/text/cases/context.go +376 -0
- data/ext/vendor/golang.org/x/text/cases/context_test.go +438 -0
- data/ext/vendor/golang.org/x/text/cases/example_test.go +53 -0
- data/ext/vendor/golang.org/x/text/cases/fold.go +34 -0
- data/ext/vendor/golang.org/x/text/cases/fold_test.go +51 -0
- data/ext/vendor/golang.org/x/text/cases/gen.go +839 -0
- data/ext/vendor/golang.org/x/text/cases/gen_trieval.go +219 -0
- data/ext/vendor/golang.org/x/text/cases/icu.go +61 -0
- data/ext/vendor/golang.org/x/text/cases/icu_test.go +210 -0
- data/ext/vendor/golang.org/x/text/cases/info.go +82 -0
- data/ext/vendor/golang.org/x/text/cases/map.go +816 -0
- data/ext/vendor/golang.org/x/text/cases/map_test.go +950 -0
- data/ext/vendor/golang.org/x/text/cases/tables.go +2251 -0
- data/ext/vendor/golang.org/x/text/cases/tables_test.go +1158 -0
- data/ext/vendor/golang.org/x/text/cases/trieval.go +215 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/doc.go +35 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/extract.go +195 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/main.go +356 -0
- data/ext/vendor/golang.org/x/text/cmd/gotext/message.go +127 -0
- data/ext/vendor/golang.org/x/text/codereview.cfg +1 -0
- data/ext/vendor/golang.org/x/text/collate/build/builder.go +702 -0
- data/ext/vendor/golang.org/x/text/collate/build/builder_test.go +290 -0
- data/ext/vendor/golang.org/x/text/collate/build/colelem.go +294 -0
- data/ext/vendor/golang.org/x/text/collate/build/colelem_test.go +215 -0
- data/ext/vendor/golang.org/x/text/collate/build/contract.go +309 -0
- data/ext/vendor/golang.org/x/text/collate/build/contract_test.go +266 -0
- data/ext/vendor/golang.org/x/text/collate/build/order.go +393 -0
- data/ext/vendor/golang.org/x/text/collate/build/order_test.go +229 -0
- data/ext/vendor/golang.org/x/text/collate/build/table.go +81 -0
- data/ext/vendor/golang.org/x/text/collate/build/trie.go +290 -0
- data/ext/vendor/golang.org/x/text/collate/build/trie_test.go +107 -0
- data/ext/vendor/golang.org/x/text/collate/collate.go +403 -0
- data/ext/vendor/golang.org/x/text/collate/collate_test.go +482 -0
- data/ext/vendor/golang.org/x/text/collate/export_test.go +51 -0
- data/ext/vendor/golang.org/x/text/collate/index.go +32 -0
- data/ext/vendor/golang.org/x/text/collate/maketables.go +553 -0
- data/ext/vendor/golang.org/x/text/collate/option.go +239 -0
- data/ext/vendor/golang.org/x/text/collate/option_test.go +209 -0
- data/ext/vendor/golang.org/x/text/collate/reg_test.go +230 -0
- data/ext/vendor/golang.org/x/text/collate/sort.go +81 -0
- data/ext/vendor/golang.org/x/text/collate/sort_test.go +55 -0
- data/ext/vendor/golang.org/x/text/collate/table_test.go +291 -0
- data/ext/vendor/golang.org/x/text/collate/tables.go +73789 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/Makefile +7 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/chars.go +1156 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/col.go +97 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/colcmp.go +529 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/darwin.go +111 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/gen.go +183 -0
- data/ext/vendor/golang.org/x/text/collate/tools/colcmp/icu.go +209 -0
- data/ext/vendor/golang.org/x/text/currency/common.go +66 -0
- data/ext/vendor/golang.org/x/text/currency/currency.go +185 -0
- data/ext/vendor/golang.org/x/text/currency/currency_test.go +171 -0
- data/ext/vendor/golang.org/x/text/currency/example_test.go +27 -0
- data/ext/vendor/golang.org/x/text/currency/format.go +215 -0
- data/ext/vendor/golang.org/x/text/currency/format_test.go +70 -0
- data/ext/vendor/golang.org/x/text/currency/gen.go +400 -0
- data/ext/vendor/golang.org/x/text/currency/gen_common.go +70 -0
- data/ext/vendor/golang.org/x/text/currency/query.go +152 -0
- data/ext/vendor/golang.org/x/text/currency/query_test.go +107 -0
- data/ext/vendor/golang.org/x/text/currency/tables.go +2574 -0
- data/ext/vendor/golang.org/x/text/currency/tables_test.go +93 -0
- data/ext/vendor/golang.org/x/text/doc.go +13 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/charmap.go +249 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/charmap_test.go +258 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/maketables.go +556 -0
- data/ext/vendor/golang.org/x/text/encoding/charmap/tables.go +7410 -0
- data/ext/vendor/golang.org/x/text/encoding/encoding.go +335 -0
- data/ext/vendor/golang.org/x/text/encoding/encoding_test.go +290 -0
- data/ext/vendor/golang.org/x/text/encoding/example_test.go +42 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/gen.go +173 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go +86 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/htmlindex_test.go +144 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/map.go +105 -0
- data/ext/vendor/golang.org/x/text/encoding/htmlindex/tables.go +352 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/example_test.go +27 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/gen.go +192 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/ianaindex.go +209 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/ianaindex_test.go +192 -0
- data/ext/vendor/golang.org/x/text/encoding/ianaindex/tables.go +2348 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/enctest/enctest.go +180 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/identifier/gen.go +137 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/identifier/identifier.go +81 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/identifier/mib.go +1621 -0
- data/ext/vendor/golang.org/x/text/encoding/internal/internal.go +75 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/all.go +12 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/all_test.go +248 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/eucjp.go +225 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go +299 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/maketables.go +161 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/shiftjis.go +189 -0
- data/ext/vendor/golang.org/x/text/encoding/japanese/tables.go +26971 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/all_test.go +94 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/euckr.go +177 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/maketables.go +143 -0
- data/ext/vendor/golang.org/x/text/encoding/korean/tables.go +34152 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/all.go +12 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/all_test.go +143 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go +269 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go +245 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go +161 -0
- data/ext/vendor/golang.org/x/text/encoding/simplifiedchinese/tables.go +43999 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-gb18030.txt +510 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-utf-16le.txt +0 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-utf-32be.txt +0 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-utf-8.txt +510 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/candide-windows-1252.txt +510 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-euc-jp.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-iso-2022-jp.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-shift-jis.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/rashomon-utf-8.txt +178 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-gb-levels-1-and-2-hz-gb2312.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-gb-levels-1-and-2-utf-8.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-simplified-gbk.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-simplified-utf-8.txt +107 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-traditional-big5.txt +106 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-traditional-utf-8.txt +106 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/unsu-joh-eun-nal-euc-kr.txt +175 -0
- data/ext/vendor/golang.org/x/text/encoding/testdata/unsu-joh-eun-nal-utf-8.txt +175 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/all_test.go +114 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/big5.go +199 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go +140 -0
- data/ext/vendor/golang.org/x/text/encoding/traditionalchinese/tables.go +37142 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/override.go +82 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/unicode.go +434 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/unicode_test.go +499 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/utf32/utf32.go +296 -0
- data/ext/vendor/golang.org/x/text/encoding/unicode/utf32/utf32_test.go +248 -0
- data/ext/vendor/golang.org/x/text/feature/plural/common.go +70 -0
- data/ext/vendor/golang.org/x/text/feature/plural/data_test.go +190 -0
- data/ext/vendor/golang.org/x/text/feature/plural/example_test.go +46 -0
- data/ext/vendor/golang.org/x/text/feature/plural/gen.go +513 -0
- data/ext/vendor/golang.org/x/text/feature/plural/gen_common.go +74 -0
- data/ext/vendor/golang.org/x/text/feature/plural/message.go +244 -0
- data/ext/vendor/golang.org/x/text/feature/plural/message_test.go +197 -0
- data/ext/vendor/golang.org/x/text/feature/plural/plural.go +258 -0
- data/ext/vendor/golang.org/x/text/feature/plural/plural_test.go +216 -0
- data/ext/vendor/golang.org/x/text/feature/plural/tables.go +540 -0
- data/ext/vendor/golang.org/x/text/gen.go +318 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/catmsg.go +366 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go +316 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/codec.go +407 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/varint.go +62 -0
- data/ext/vendor/golang.org/x/text/internal/catmsg/varint_test.go +123 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/collate_test.go +121 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/collelem.go +371 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/collelem_test.go +183 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/colltab.go +105 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/colltab_test.go +64 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/contract.go +145 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/contract_test.go +131 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/iter.go +178 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/iter_test.go +63 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/numeric.go +236 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/numeric_test.go +159 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/table.go +275 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/trie.go +159 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/trie_test.go +106 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/weighter.go +31 -0
- data/ext/vendor/golang.org/x/text/internal/colltab/weighter_test.go +42 -0
- data/ext/vendor/golang.org/x/text/internal/export/README +4 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/common_test.go +55 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/example_test.go +68 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen.go +276 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen_common.go +59 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen_test.go +91 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/gen_trieval.go +123 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/idna.go +717 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/idna_test.go +308 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/punycode.go +201 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/punycode_test.go +198 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/tables.go +4557 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/trie.go +70 -0
- data/ext/vendor/golang.org/x/text/internal/export/idna/trieval.go +119 -0
- data/ext/vendor/golang.org/x/text/internal/format/format.go +41 -0
- data/ext/vendor/golang.org/x/text/internal/gen.go +52 -0
- data/ext/vendor/golang.org/x/text/internal/gen/code.go +351 -0
- data/ext/vendor/golang.org/x/text/internal/gen/gen.go +281 -0
- data/ext/vendor/golang.org/x/text/internal/gen_test.go +38 -0
- data/ext/vendor/golang.org/x/text/internal/internal.go +51 -0
- data/ext/vendor/golang.org/x/text/internal/internal_test.go +38 -0
- data/ext/vendor/golang.org/x/text/internal/match.go +67 -0
- data/ext/vendor/golang.org/x/text/internal/match_test.go +56 -0
- data/ext/vendor/golang.org/x/text/internal/number/common.go +40 -0
- data/ext/vendor/golang.org/x/text/internal/number/decimal.go +498 -0
- data/ext/vendor/golang.org/x/text/internal/number/decimal_test.go +329 -0
- data/ext/vendor/golang.org/x/text/internal/number/format.go +540 -0
- data/ext/vendor/golang.org/x/text/internal/number/format_test.go +522 -0
- data/ext/vendor/golang.org/x/text/internal/number/gen.go +458 -0
- data/ext/vendor/golang.org/x/text/internal/number/gen_common.go +44 -0
- data/ext/vendor/golang.org/x/text/internal/number/number.go +154 -0
- data/ext/vendor/golang.org/x/text/internal/number/number_test.go +100 -0
- data/ext/vendor/golang.org/x/text/internal/number/pattern.go +485 -0
- data/ext/vendor/golang.org/x/text/internal/number/pattern_test.go +438 -0
- data/ext/vendor/golang.org/x/text/internal/number/roundingmode_string.go +16 -0
- data/ext/vendor/golang.org/x/text/internal/number/tables.go +1154 -0
- data/ext/vendor/golang.org/x/text/internal/number/tables_test.go +125 -0
- data/ext/vendor/golang.org/x/text/internal/stringset/set.go +86 -0
- data/ext/vendor/golang.org/x/text/internal/stringset/set_test.go +53 -0
- data/ext/vendor/golang.org/x/text/internal/tables.go +117 -0
- data/ext/vendor/golang.org/x/text/internal/tag/tag.go +100 -0
- data/ext/vendor/golang.org/x/text/internal/tag/tag_test.go +67 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/codesize.go +53 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/flag.go +22 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/gc.go +14 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/gccgo.go +11 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/go1_6.go +23 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/go1_7.go +17 -0
- data/ext/vendor/golang.org/x/text/internal/testtext/text.go +105 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/compact.go +58 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/data_test.go +875 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/example_compact_test.go +71 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/example_test.go +148 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/gen_test.go +68 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/print.go +251 -0
- data/ext/vendor/golang.org/x/text/internal/triegen/triegen.go +494 -0
- data/ext/vendor/golang.org/x/text/internal/ucd/example_test.go +81 -0
- data/ext/vendor/golang.org/x/text/internal/ucd/ucd.go +371 -0
- data/ext/vendor/golang.org/x/text/internal/ucd/ucd_test.go +105 -0
- data/ext/vendor/golang.org/x/text/internal/utf8internal/utf8internal.go +87 -0
- data/ext/vendor/golang.org/x/text/language/Makefile +16 -0
- data/ext/vendor/golang.org/x/text/language/common.go +16 -0
- data/ext/vendor/golang.org/x/text/language/coverage.go +197 -0
- data/ext/vendor/golang.org/x/text/language/coverage_test.go +154 -0
- data/ext/vendor/golang.org/x/text/language/display/dict.go +92 -0
- data/ext/vendor/golang.org/x/text/language/display/dict_test.go +39 -0
- data/ext/vendor/golang.org/x/text/language/display/display.go +420 -0
- data/ext/vendor/golang.org/x/text/language/display/display_test.go +705 -0
- data/ext/vendor/golang.org/x/text/language/display/examples_test.go +116 -0
- data/ext/vendor/golang.org/x/text/language/display/lookup.go +251 -0
- data/ext/vendor/golang.org/x/text/language/display/maketables.go +602 -0
- data/ext/vendor/golang.org/x/text/language/display/tables.go +50344 -0
- data/ext/vendor/golang.org/x/text/language/doc.go +102 -0
- data/ext/vendor/golang.org/x/text/language/examples_test.go +413 -0
- data/ext/vendor/golang.org/x/text/language/gen.go +1706 -0
- data/ext/vendor/golang.org/x/text/language/gen_common.go +20 -0
- data/ext/vendor/golang.org/x/text/language/gen_index.go +162 -0
- data/ext/vendor/golang.org/x/text/language/go1_1.go +38 -0
- data/ext/vendor/golang.org/x/text/language/go1_2.go +11 -0
- data/ext/vendor/golang.org/x/text/language/httpexample_test.go +48 -0
- data/ext/vendor/golang.org/x/text/language/index.go +769 -0
- data/ext/vendor/golang.org/x/text/language/language.go +887 -0
- data/ext/vendor/golang.org/x/text/language/language_test.go +878 -0
- data/ext/vendor/golang.org/x/text/language/lookup.go +396 -0
- data/ext/vendor/golang.org/x/text/language/lookup_test.go +457 -0
- data/ext/vendor/golang.org/x/text/language/match.go +933 -0
- data/ext/vendor/golang.org/x/text/language/match_test.go +505 -0
- data/ext/vendor/golang.org/x/text/language/parse.go +859 -0
- data/ext/vendor/golang.org/x/text/language/parse_test.go +517 -0
- data/ext/vendor/golang.org/x/text/language/tables.go +3675 -0
- data/ext/vendor/golang.org/x/text/language/tags.go +143 -0
- data/ext/vendor/golang.org/x/text/language/testdata/CLDRLocaleMatcherTest.txt +389 -0
- data/ext/vendor/golang.org/x/text/language/testdata/GoLocaleMatcherTest.txt +226 -0
- data/ext/vendor/golang.org/x/text/message/catalog.go +28 -0
- data/ext/vendor/golang.org/x/text/message/catalog/catalog.go +292 -0
- data/ext/vendor/golang.org/x/text/message/catalog/catalog_test.go +194 -0
- data/ext/vendor/golang.org/x/text/message/catalog/dict.go +90 -0
- data/ext/vendor/golang.org/x/text/message/doc.go +100 -0
- data/ext/vendor/golang.org/x/text/message/examples_test.go +42 -0
- data/ext/vendor/golang.org/x/text/message/fmt_test.go +1889 -0
- data/ext/vendor/golang.org/x/text/message/format.go +532 -0
- data/ext/vendor/golang.org/x/text/message/message.go +169 -0
- data/ext/vendor/golang.org/x/text/message/message_test.go +181 -0
- data/ext/vendor/golang.org/x/text/message/print.go +1194 -0
- data/ext/vendor/golang.org/x/text/number/doc.go +28 -0
- data/ext/vendor/golang.org/x/text/number/examples_test.go +28 -0
- data/ext/vendor/golang.org/x/text/number/format.go +122 -0
- data/ext/vendor/golang.org/x/text/number/format_test.go +107 -0
- data/ext/vendor/golang.org/x/text/number/number.go +77 -0
- data/ext/vendor/golang.org/x/text/number/number_test.go +190 -0
- data/ext/vendor/golang.org/x/text/number/option.go +177 -0
- data/ext/vendor/golang.org/x/text/runes/cond.go +187 -0
- data/ext/vendor/golang.org/x/text/runes/cond_test.go +282 -0
- data/ext/vendor/golang.org/x/text/runes/example_test.go +60 -0
- data/ext/vendor/golang.org/x/text/runes/runes.go +355 -0
- data/ext/vendor/golang.org/x/text/runes/runes_test.go +664 -0
- data/ext/vendor/golang.org/x/text/search/index.go +35 -0
- data/ext/vendor/golang.org/x/text/search/pattern.go +155 -0
- data/ext/vendor/golang.org/x/text/search/pattern_test.go +357 -0
- data/ext/vendor/golang.org/x/text/search/search.go +237 -0
- data/ext/vendor/golang.org/x/text/search/tables.go +12448 -0
- data/ext/vendor/golang.org/x/text/secure/bidirule/bench_test.go +54 -0
- data/ext/vendor/golang.org/x/text/secure/bidirule/bidirule.go +340 -0
- data/ext/vendor/golang.org/x/text/secure/bidirule/bidirule_test.go +851 -0
- data/ext/vendor/golang.org/x/text/secure/doc.go +6 -0
- data/ext/vendor/golang.org/x/text/secure/precis/benchmark_test.go +82 -0
- data/ext/vendor/golang.org/x/text/secure/precis/class.go +36 -0
- data/ext/vendor/golang.org/x/text/secure/precis/class_test.go +50 -0
- data/ext/vendor/golang.org/x/text/secure/precis/context.go +139 -0
- data/ext/vendor/golang.org/x/text/secure/precis/doc.go +14 -0
- data/ext/vendor/golang.org/x/text/secure/precis/enforce_test.go +396 -0
- data/ext/vendor/golang.org/x/text/secure/precis/gen.go +310 -0
- data/ext/vendor/golang.org/x/text/secure/precis/gen_trieval.go +68 -0
- data/ext/vendor/golang.org/x/text/secure/precis/nickname.go +72 -0
- data/ext/vendor/golang.org/x/text/secure/precis/options.go +157 -0
- data/ext/vendor/golang.org/x/text/secure/precis/profile.go +402 -0
- data/ext/vendor/golang.org/x/text/secure/precis/profile_test.go +149 -0
- data/ext/vendor/golang.org/x/text/secure/precis/profiles.go +78 -0
- data/ext/vendor/golang.org/x/text/secure/precis/tables.go +3887 -0
- data/ext/vendor/golang.org/x/text/secure/precis/tables_test.go +69 -0
- data/ext/vendor/golang.org/x/text/secure/precis/transformer.go +32 -0
- data/ext/vendor/golang.org/x/text/secure/precis/trieval.go +64 -0
- data/ext/vendor/golang.org/x/text/transform/examples_test.go +37 -0
- data/ext/vendor/golang.org/x/text/transform/transform.go +705 -0
- data/ext/vendor/golang.org/x/text/transform/transform_test.go +1317 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/bidi.go +198 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/core.go +1058 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/core_test.go +224 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/gen.go +133 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go +57 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go +64 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/ranges_test.go +53 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/tables.go +1813 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/tables_test.go +82 -0
- data/ext/vendor/golang.org/x/text/unicode/bidi/trieval.go +60 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/base.go +100 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/cldr.go +130 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/cldr_test.go +27 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/collate.go +359 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/collate_test.go +275 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/data_test.go +186 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/decode.go +171 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/examples_test.go +21 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/makexml.go +400 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/resolve.go +602 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/resolve_test.go +368 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/slice.go +144 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/slice_test.go +175 -0
- data/ext/vendor/golang.org/x/text/unicode/cldr/xml.go +1487 -0
- data/ext/vendor/golang.org/x/text/unicode/doc.go +8 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/composition.go +508 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/composition_test.go +130 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/example_iter_test.go +82 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/example_test.go +27 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/forminfo.go +259 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/forminfo_test.go +54 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/iter.go +457 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/iter_test.go +98 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/maketables.go +976 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/norm_test.go +14 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/normalize.go +609 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/normalize_test.go +1287 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/readwriter_test.go +56 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/tables.go +7651 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/transform_test.go +101 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/triegen.go +117 -0
- data/ext/vendor/golang.org/x/text/unicode/norm/ucd_test.go +275 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/gen.go +115 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/merge.go +260 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/merge_test.go +184 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/rangetable.go +70 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/rangetable_test.go +55 -0
- data/ext/vendor/golang.org/x/text/unicode/rangetable/tables.go +6376 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/bits.go +59 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/example_test.go +118 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/gen.go +195 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/gen_bits.go +63 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/runenames.go +48 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/runenames_test.go +46 -0
- data/ext/vendor/golang.org/x/text/unicode/runenames/tables.go +15514 -0
- data/ext/vendor/golang.org/x/text/width/common_test.go +92 -0
- data/ext/vendor/golang.org/x/text/width/example_test.go +52 -0
- data/ext/vendor/golang.org/x/text/width/gen.go +115 -0
- data/ext/vendor/golang.org/x/text/width/gen_common.go +96 -0
- data/ext/vendor/golang.org/x/text/width/gen_trieval.go +34 -0
- data/ext/vendor/golang.org/x/text/width/kind_string.go +16 -0
- data/ext/vendor/golang.org/x/text/width/runes_test.go +461 -0
- data/ext/vendor/golang.org/x/text/width/tables.go +1316 -0
- data/ext/vendor/golang.org/x/text/width/tables_test.go +59 -0
- data/ext/vendor/golang.org/x/text/width/transform.go +239 -0
- data/ext/vendor/golang.org/x/text/width/transform_test.go +701 -0
- data/ext/vendor/golang.org/x/text/width/trieval.go +30 -0
- data/ext/vendor/golang.org/x/text/width/width.go +206 -0
- data/lib/ires/version.rb +1 -1
- data/shared/darwin/ires.so +0 -0
- data/shared/linux/ires.so +0 -0
- metadata +1011 -23
- data/ext/operate/image.go +0 -176
- data/ext/util/uri/uri.go +0 -105
- data/ext/vendor/github.com/satori/go.uuid/README.md +0 -65
- data/ext/vendor/github.com/satori/go.uuid/benchmarks_test.go +0 -121
- data/ext/vendor/github.com/satori/go.uuid/uuid.go +0 -488
- data/ext/vendor/github.com/satori/go.uuid/uuid_test.go +0 -633
@@ -0,0 +1,53 @@
|
|
1
|
+
package purell
|
2
|
+
|
3
|
+
import (
|
4
|
+
"testing"
|
5
|
+
)
|
6
|
+
|
7
|
+
// Test cases merged from PR #1
|
8
|
+
// Originally from https://github.com/jehiah/urlnorm/blob/master/test_urlnorm.py
|
9
|
+
|
10
|
+
func assertMap(t *testing.T, cases map[string]string, f NormalizationFlags) {
|
11
|
+
for bad, good := range cases {
|
12
|
+
s, e := NormalizeURLString(bad, f)
|
13
|
+
if e != nil {
|
14
|
+
t.Errorf("%s normalizing %v to %v", e.Error(), bad, good)
|
15
|
+
} else {
|
16
|
+
if s != good {
|
17
|
+
t.Errorf("source: %v expected: %v got: %v", bad, good, s)
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
// This tests normalization to a unicode representation
|
24
|
+
// precent escapes for unreserved values are unescaped to their unicode value
|
25
|
+
// tests normalization to idna domains
|
26
|
+
// test ip word handling, ipv6 address handling, and trailing domain periods
|
27
|
+
// in general, this matches google chromes unescaping for things in the address bar.
|
28
|
+
// spaces are converted to '+' (perhaphs controversial)
|
29
|
+
// http://code.google.com/p/google-url/ probably is another good reference for this approach
|
30
|
+
func TestUrlnorm(t *testing.T) {
|
31
|
+
testcases := map[string]string{
|
32
|
+
"http://test.example/?a=%e3%82%82%26": "http://test.example/?a=%e3%82%82%26",
|
33
|
+
//"http://test.example/?a=%e3%82%82%26": "http://test.example/?a=\xe3\x82\x82%26", //should return a unicode character
|
34
|
+
"http://s.xn--q-bga.DE/": "http://s.xn--q-bga.de/", //should be in idna format
|
35
|
+
"http://XBLA\u306eXbox.com": "http://xn--xblaxbox-jf4g.com", //test utf8 and unicode
|
36
|
+
"http://президент.рф": "http://xn--d1abbgf6aiiy.xn--p1ai",
|
37
|
+
"http://ПРЕЗИДЕНТ.РФ": "http://xn--d1abbgf6aiiy.xn--p1ai",
|
38
|
+
"http://ab¥ヲ₩○.com": "http://xn--ab-ida8983azmfnvs.com", //test width folding
|
39
|
+
"http://\u00e9.com": "http://xn--9ca.com",
|
40
|
+
"http://e\u0301.com": "http://xn--9ca.com",
|
41
|
+
"http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%82%BF%E3%83%94%E3%83%A9%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%91%E3%83%B3": "http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%82%BF%E3%83%94%E3%83%A9%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%91%E3%83%B3",
|
42
|
+
//"http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%82%BF%E3%83%94%E3%83%A9%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%91%E3%83%B3": "http://ja.wikipedia.org/wiki/\xe3\x82\xad\xe3\x83\xa3\xe3\x82\xbf\xe3\x83\x94\xe3\x83\xa9\xe3\x83\xbc\xe3\x82\xb8\xe3\x83\xa3\xe3\x83\x91\xe3\x83\xb3",
|
43
|
+
|
44
|
+
"http://test.example/\xe3\x82\xad": "http://test.example/%E3%82%AD",
|
45
|
+
//"http://test.example/\xe3\x82\xad": "http://test.example/\xe3\x82\xad",
|
46
|
+
"http://test.example/?p=%23val#test-%23-val%25": "http://test.example/?p=%23val#test-%23-val%25", //check that %23 (#) is not escaped where it shouldn't be
|
47
|
+
|
48
|
+
"http://test.domain/I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%EF%BF%BDliz%C3%A6ti%C3%B8n": "http://test.domain/I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%EF%BF%BDliz%C3%A6ti%C3%B8n",
|
49
|
+
//"http://test.domain/I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%EF%BF%BDliz%C3%A6ti%C3%B8n": "http://test.domain/I\xc3\xb1t\xc3\xabrn\xc3\xa2ti\xc3\xb4n\xef\xbf\xbdliz\xc3\xa6ti\xc3\xb8n",
|
50
|
+
}
|
51
|
+
|
52
|
+
assertMap(t, testcases, FlagsSafe|FlagRemoveDotSegments)
|
53
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Copyright (c) 2012 The Go Authors. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions are
|
5
|
+
met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above
|
10
|
+
copyright notice, this list of conditions and the following disclaimer
|
11
|
+
in the documentation and/or other materials provided with the
|
12
|
+
distribution.
|
13
|
+
* Neither the name of Google Inc. nor the names of its
|
14
|
+
contributors may be used to endorse or promote products derived from
|
15
|
+
this software without specific prior written permission.
|
16
|
+
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
18
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
19
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
20
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
21
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
22
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
23
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
24
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
25
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
urlesc [![Build Status](https://travis-ci.org/PuerkitoBio/urlesc.svg?branch=master)](https://travis-ci.org/PuerkitoBio/urlesc) [![GoDoc](http://godoc.org/github.com/PuerkitoBio/urlesc?status.svg)](http://godoc.org/github.com/PuerkitoBio/urlesc)
|
2
|
+
======
|
3
|
+
|
4
|
+
Package urlesc implements query escaping as per RFC 3986.
|
5
|
+
|
6
|
+
It contains some parts of the net/url package, modified so as to allow
|
7
|
+
some reserved characters incorrectly escaped by net/url (see [issue 5684](https://github.com/golang/go/issues/5684)).
|
8
|
+
|
9
|
+
## Install
|
10
|
+
|
11
|
+
go get github.com/PuerkitoBio/urlesc
|
12
|
+
|
13
|
+
## License
|
14
|
+
|
15
|
+
Go license (BSD-3-Clause)
|
16
|
+
|
@@ -0,0 +1,180 @@
|
|
1
|
+
// Copyright 2009 The Go Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style
|
3
|
+
// license that can be found in the LICENSE file.
|
4
|
+
|
5
|
+
// Package urlesc implements query escaping as per RFC 3986.
|
6
|
+
// It contains some parts of the net/url package, modified so as to allow
|
7
|
+
// some reserved characters incorrectly escaped by net/url.
|
8
|
+
// See https://github.com/golang/go/issues/5684
|
9
|
+
package urlesc
|
10
|
+
|
11
|
+
import (
|
12
|
+
"bytes"
|
13
|
+
"net/url"
|
14
|
+
"strings"
|
15
|
+
)
|
16
|
+
|
17
|
+
type encoding int
|
18
|
+
|
19
|
+
const (
|
20
|
+
encodePath encoding = 1 + iota
|
21
|
+
encodeUserPassword
|
22
|
+
encodeQueryComponent
|
23
|
+
encodeFragment
|
24
|
+
)
|
25
|
+
|
26
|
+
// Return true if the specified character should be escaped when
|
27
|
+
// appearing in a URL string, according to RFC 3986.
|
28
|
+
func shouldEscape(c byte, mode encoding) bool {
|
29
|
+
// §2.3 Unreserved characters (alphanum)
|
30
|
+
if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' {
|
31
|
+
return false
|
32
|
+
}
|
33
|
+
|
34
|
+
switch c {
|
35
|
+
case '-', '.', '_', '~': // §2.3 Unreserved characters (mark)
|
36
|
+
return false
|
37
|
+
|
38
|
+
// §2.2 Reserved characters (reserved)
|
39
|
+
case ':', '/', '?', '#', '[', ']', '@', // gen-delims
|
40
|
+
'!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims
|
41
|
+
// Different sections of the URL allow a few of
|
42
|
+
// the reserved characters to appear unescaped.
|
43
|
+
switch mode {
|
44
|
+
case encodePath: // §3.3
|
45
|
+
// The RFC allows sub-delims and : @.
|
46
|
+
// '/', '[' and ']' can be used to assign meaning to individual path
|
47
|
+
// segments. This package only manipulates the path as a whole,
|
48
|
+
// so we allow those as well. That leaves only ? and # to escape.
|
49
|
+
return c == '?' || c == '#'
|
50
|
+
|
51
|
+
case encodeUserPassword: // §3.2.1
|
52
|
+
// The RFC allows : and sub-delims in
|
53
|
+
// userinfo. The parsing of userinfo treats ':' as special so we must escape
|
54
|
+
// all the gen-delims.
|
55
|
+
return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@'
|
56
|
+
|
57
|
+
case encodeQueryComponent: // §3.4
|
58
|
+
// The RFC allows / and ?.
|
59
|
+
return c != '/' && c != '?'
|
60
|
+
|
61
|
+
case encodeFragment: // §4.1
|
62
|
+
// The RFC text is silent but the grammar allows
|
63
|
+
// everything, so escape nothing but #
|
64
|
+
return c == '#'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
// Everything else must be escaped.
|
69
|
+
return true
|
70
|
+
}
|
71
|
+
|
72
|
+
// QueryEscape escapes the string so it can be safely placed
|
73
|
+
// inside a URL query.
|
74
|
+
func QueryEscape(s string) string {
|
75
|
+
return escape(s, encodeQueryComponent)
|
76
|
+
}
|
77
|
+
|
78
|
+
func escape(s string, mode encoding) string {
|
79
|
+
spaceCount, hexCount := 0, 0
|
80
|
+
for i := 0; i < len(s); i++ {
|
81
|
+
c := s[i]
|
82
|
+
if shouldEscape(c, mode) {
|
83
|
+
if c == ' ' && mode == encodeQueryComponent {
|
84
|
+
spaceCount++
|
85
|
+
} else {
|
86
|
+
hexCount++
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
if spaceCount == 0 && hexCount == 0 {
|
92
|
+
return s
|
93
|
+
}
|
94
|
+
|
95
|
+
t := make([]byte, len(s)+2*hexCount)
|
96
|
+
j := 0
|
97
|
+
for i := 0; i < len(s); i++ {
|
98
|
+
switch c := s[i]; {
|
99
|
+
case c == ' ' && mode == encodeQueryComponent:
|
100
|
+
t[j] = '+'
|
101
|
+
j++
|
102
|
+
case shouldEscape(c, mode):
|
103
|
+
t[j] = '%'
|
104
|
+
t[j+1] = "0123456789ABCDEF"[c>>4]
|
105
|
+
t[j+2] = "0123456789ABCDEF"[c&15]
|
106
|
+
j += 3
|
107
|
+
default:
|
108
|
+
t[j] = s[i]
|
109
|
+
j++
|
110
|
+
}
|
111
|
+
}
|
112
|
+
return string(t)
|
113
|
+
}
|
114
|
+
|
115
|
+
var uiReplacer = strings.NewReplacer(
|
116
|
+
"%21", "!",
|
117
|
+
"%27", "'",
|
118
|
+
"%28", "(",
|
119
|
+
"%29", ")",
|
120
|
+
"%2A", "*",
|
121
|
+
)
|
122
|
+
|
123
|
+
// unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986.
|
124
|
+
func unescapeUserinfo(s string) string {
|
125
|
+
return uiReplacer.Replace(s)
|
126
|
+
}
|
127
|
+
|
128
|
+
// Escape reassembles the URL into a valid URL string.
|
129
|
+
// The general form of the result is one of:
|
130
|
+
//
|
131
|
+
// scheme:opaque
|
132
|
+
// scheme://userinfo@host/path?query#fragment
|
133
|
+
//
|
134
|
+
// If u.Opaque is non-empty, String uses the first form;
|
135
|
+
// otherwise it uses the second form.
|
136
|
+
//
|
137
|
+
// In the second form, the following rules apply:
|
138
|
+
// - if u.Scheme is empty, scheme: is omitted.
|
139
|
+
// - if u.User is nil, userinfo@ is omitted.
|
140
|
+
// - if u.Host is empty, host/ is omitted.
|
141
|
+
// - if u.Scheme and u.Host are empty and u.User is nil,
|
142
|
+
// the entire scheme://userinfo@host/ is omitted.
|
143
|
+
// - if u.Host is non-empty and u.Path begins with a /,
|
144
|
+
// the form host/path does not add its own /.
|
145
|
+
// - if u.RawQuery is empty, ?query is omitted.
|
146
|
+
// - if u.Fragment is empty, #fragment is omitted.
|
147
|
+
func Escape(u *url.URL) string {
|
148
|
+
var buf bytes.Buffer
|
149
|
+
if u.Scheme != "" {
|
150
|
+
buf.WriteString(u.Scheme)
|
151
|
+
buf.WriteByte(':')
|
152
|
+
}
|
153
|
+
if u.Opaque != "" {
|
154
|
+
buf.WriteString(u.Opaque)
|
155
|
+
} else {
|
156
|
+
if u.Scheme != "" || u.Host != "" || u.User != nil {
|
157
|
+
buf.WriteString("//")
|
158
|
+
if ui := u.User; ui != nil {
|
159
|
+
buf.WriteString(unescapeUserinfo(ui.String()))
|
160
|
+
buf.WriteByte('@')
|
161
|
+
}
|
162
|
+
if h := u.Host; h != "" {
|
163
|
+
buf.WriteString(h)
|
164
|
+
}
|
165
|
+
}
|
166
|
+
if u.Path != "" && u.Path[0] != '/' && u.Host != "" {
|
167
|
+
buf.WriteByte('/')
|
168
|
+
}
|
169
|
+
buf.WriteString(escape(u.Path, encodePath))
|
170
|
+
}
|
171
|
+
if u.RawQuery != "" {
|
172
|
+
buf.WriteByte('?')
|
173
|
+
buf.WriteString(u.RawQuery)
|
174
|
+
}
|
175
|
+
if u.Fragment != "" {
|
176
|
+
buf.WriteByte('#')
|
177
|
+
buf.WriteString(escape(u.Fragment, encodeFragment))
|
178
|
+
}
|
179
|
+
return buf.String()
|
180
|
+
}
|
@@ -0,0 +1,641 @@
|
|
1
|
+
// Copyright 2009 The Go Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style
|
3
|
+
// license that can be found in the LICENSE file.
|
4
|
+
|
5
|
+
package urlesc
|
6
|
+
|
7
|
+
import (
|
8
|
+
"net/url"
|
9
|
+
"testing"
|
10
|
+
)
|
11
|
+
|
12
|
+
type URLTest struct {
|
13
|
+
in string
|
14
|
+
out *url.URL
|
15
|
+
roundtrip string // expected result of reserializing the URL; empty means same as "in".
|
16
|
+
}
|
17
|
+
|
18
|
+
var urltests = []URLTest{
|
19
|
+
// no path
|
20
|
+
{
|
21
|
+
"http://www.google.com",
|
22
|
+
&url.URL{
|
23
|
+
Scheme: "http",
|
24
|
+
Host: "www.google.com",
|
25
|
+
},
|
26
|
+
"",
|
27
|
+
},
|
28
|
+
// path
|
29
|
+
{
|
30
|
+
"http://www.google.com/",
|
31
|
+
&url.URL{
|
32
|
+
Scheme: "http",
|
33
|
+
Host: "www.google.com",
|
34
|
+
Path: "/",
|
35
|
+
},
|
36
|
+
"",
|
37
|
+
},
|
38
|
+
// path with hex escaping
|
39
|
+
{
|
40
|
+
"http://www.google.com/file%20one%26two",
|
41
|
+
&url.URL{
|
42
|
+
Scheme: "http",
|
43
|
+
Host: "www.google.com",
|
44
|
+
Path: "/file one&two",
|
45
|
+
},
|
46
|
+
"http://www.google.com/file%20one&two",
|
47
|
+
},
|
48
|
+
// user
|
49
|
+
{
|
50
|
+
"ftp://webmaster@www.google.com/",
|
51
|
+
&url.URL{
|
52
|
+
Scheme: "ftp",
|
53
|
+
User: url.User("webmaster"),
|
54
|
+
Host: "www.google.com",
|
55
|
+
Path: "/",
|
56
|
+
},
|
57
|
+
"",
|
58
|
+
},
|
59
|
+
// escape sequence in username
|
60
|
+
{
|
61
|
+
"ftp://john%20doe@www.google.com/",
|
62
|
+
&url.URL{
|
63
|
+
Scheme: "ftp",
|
64
|
+
User: url.User("john doe"),
|
65
|
+
Host: "www.google.com",
|
66
|
+
Path: "/",
|
67
|
+
},
|
68
|
+
"ftp://john%20doe@www.google.com/",
|
69
|
+
},
|
70
|
+
// query
|
71
|
+
{
|
72
|
+
"http://www.google.com/?q=go+language",
|
73
|
+
&url.URL{
|
74
|
+
Scheme: "http",
|
75
|
+
Host: "www.google.com",
|
76
|
+
Path: "/",
|
77
|
+
RawQuery: "q=go+language",
|
78
|
+
},
|
79
|
+
"",
|
80
|
+
},
|
81
|
+
// query with hex escaping: NOT parsed
|
82
|
+
{
|
83
|
+
"http://www.google.com/?q=go%20language",
|
84
|
+
&url.URL{
|
85
|
+
Scheme: "http",
|
86
|
+
Host: "www.google.com",
|
87
|
+
Path: "/",
|
88
|
+
RawQuery: "q=go%20language",
|
89
|
+
},
|
90
|
+
"",
|
91
|
+
},
|
92
|
+
// %20 outside query
|
93
|
+
{
|
94
|
+
"http://www.google.com/a%20b?q=c+d",
|
95
|
+
&url.URL{
|
96
|
+
Scheme: "http",
|
97
|
+
Host: "www.google.com",
|
98
|
+
Path: "/a b",
|
99
|
+
RawQuery: "q=c+d",
|
100
|
+
},
|
101
|
+
"",
|
102
|
+
},
|
103
|
+
// path without leading /, so no parsing
|
104
|
+
{
|
105
|
+
"http:www.google.com/?q=go+language",
|
106
|
+
&url.URL{
|
107
|
+
Scheme: "http",
|
108
|
+
Opaque: "www.google.com/",
|
109
|
+
RawQuery: "q=go+language",
|
110
|
+
},
|
111
|
+
"http:www.google.com/?q=go+language",
|
112
|
+
},
|
113
|
+
// path without leading /, so no parsing
|
114
|
+
{
|
115
|
+
"http:%2f%2fwww.google.com/?q=go+language",
|
116
|
+
&url.URL{
|
117
|
+
Scheme: "http",
|
118
|
+
Opaque: "%2f%2fwww.google.com/",
|
119
|
+
RawQuery: "q=go+language",
|
120
|
+
},
|
121
|
+
"http:%2f%2fwww.google.com/?q=go+language",
|
122
|
+
},
|
123
|
+
// non-authority with path
|
124
|
+
{
|
125
|
+
"mailto:/webmaster@golang.org",
|
126
|
+
&url.URL{
|
127
|
+
Scheme: "mailto",
|
128
|
+
Path: "/webmaster@golang.org",
|
129
|
+
},
|
130
|
+
"mailto:///webmaster@golang.org", // unfortunate compromise
|
131
|
+
},
|
132
|
+
// non-authority
|
133
|
+
{
|
134
|
+
"mailto:webmaster@golang.org",
|
135
|
+
&url.URL{
|
136
|
+
Scheme: "mailto",
|
137
|
+
Opaque: "webmaster@golang.org",
|
138
|
+
},
|
139
|
+
"",
|
140
|
+
},
|
141
|
+
// unescaped :// in query should not create a scheme
|
142
|
+
{
|
143
|
+
"/foo?query=http://bad",
|
144
|
+
&url.URL{
|
145
|
+
Path: "/foo",
|
146
|
+
RawQuery: "query=http://bad",
|
147
|
+
},
|
148
|
+
"",
|
149
|
+
},
|
150
|
+
// leading // without scheme should create an authority
|
151
|
+
{
|
152
|
+
"//foo",
|
153
|
+
&url.URL{
|
154
|
+
Host: "foo",
|
155
|
+
},
|
156
|
+
"",
|
157
|
+
},
|
158
|
+
// leading // without scheme, with userinfo, path, and query
|
159
|
+
{
|
160
|
+
"//user@foo/path?a=b",
|
161
|
+
&url.URL{
|
162
|
+
User: url.User("user"),
|
163
|
+
Host: "foo",
|
164
|
+
Path: "/path",
|
165
|
+
RawQuery: "a=b",
|
166
|
+
},
|
167
|
+
"",
|
168
|
+
},
|
169
|
+
// Three leading slashes isn't an authority, but doesn't return an error.
|
170
|
+
// (We can't return an error, as this code is also used via
|
171
|
+
// ServeHTTP -> ReadRequest -> Parse, which is arguably a
|
172
|
+
// different URL parsing context, but currently shares the
|
173
|
+
// same codepath)
|
174
|
+
{
|
175
|
+
"///threeslashes",
|
176
|
+
&url.URL{
|
177
|
+
Path: "///threeslashes",
|
178
|
+
},
|
179
|
+
"",
|
180
|
+
},
|
181
|
+
{
|
182
|
+
"http://user:password@google.com",
|
183
|
+
&url.URL{
|
184
|
+
Scheme: "http",
|
185
|
+
User: url.UserPassword("user", "password"),
|
186
|
+
Host: "google.com",
|
187
|
+
},
|
188
|
+
"http://user:password@google.com",
|
189
|
+
},
|
190
|
+
// unescaped @ in username should not confuse host
|
191
|
+
{
|
192
|
+
"http://j@ne:password@google.com",
|
193
|
+
&url.URL{
|
194
|
+
Scheme: "http",
|
195
|
+
User: url.UserPassword("j@ne", "password"),
|
196
|
+
Host: "google.com",
|
197
|
+
},
|
198
|
+
"http://j%40ne:password@google.com",
|
199
|
+
},
|
200
|
+
// unescaped @ in password should not confuse host
|
201
|
+
{
|
202
|
+
"http://jane:p@ssword@google.com",
|
203
|
+
&url.URL{
|
204
|
+
Scheme: "http",
|
205
|
+
User: url.UserPassword("jane", "p@ssword"),
|
206
|
+
Host: "google.com",
|
207
|
+
},
|
208
|
+
"http://jane:p%40ssword@google.com",
|
209
|
+
},
|
210
|
+
{
|
211
|
+
"http://j@ne:password@google.com/p@th?q=@go",
|
212
|
+
&url.URL{
|
213
|
+
Scheme: "http",
|
214
|
+
User: url.UserPassword("j@ne", "password"),
|
215
|
+
Host: "google.com",
|
216
|
+
Path: "/p@th",
|
217
|
+
RawQuery: "q=@go",
|
218
|
+
},
|
219
|
+
"http://j%40ne:password@google.com/p@th?q=@go",
|
220
|
+
},
|
221
|
+
{
|
222
|
+
"http://www.google.com/?q=go+language#foo",
|
223
|
+
&url.URL{
|
224
|
+
Scheme: "http",
|
225
|
+
Host: "www.google.com",
|
226
|
+
Path: "/",
|
227
|
+
RawQuery: "q=go+language",
|
228
|
+
Fragment: "foo",
|
229
|
+
},
|
230
|
+
"",
|
231
|
+
},
|
232
|
+
{
|
233
|
+
"http://www.google.com/?q=go+language#foo%26bar",
|
234
|
+
&url.URL{
|
235
|
+
Scheme: "http",
|
236
|
+
Host: "www.google.com",
|
237
|
+
Path: "/",
|
238
|
+
RawQuery: "q=go+language",
|
239
|
+
Fragment: "foo&bar",
|
240
|
+
},
|
241
|
+
"http://www.google.com/?q=go+language#foo&bar",
|
242
|
+
},
|
243
|
+
{
|
244
|
+
"file:///home/adg/rabbits",
|
245
|
+
&url.URL{
|
246
|
+
Scheme: "file",
|
247
|
+
Host: "",
|
248
|
+
Path: "/home/adg/rabbits",
|
249
|
+
},
|
250
|
+
"file:///home/adg/rabbits",
|
251
|
+
},
|
252
|
+
// "Windows" paths are no exception to the rule.
|
253
|
+
// See golang.org/issue/6027, especially comment #9.
|
254
|
+
{
|
255
|
+
"file:///C:/FooBar/Baz.txt",
|
256
|
+
&url.URL{
|
257
|
+
Scheme: "file",
|
258
|
+
Host: "",
|
259
|
+
Path: "/C:/FooBar/Baz.txt",
|
260
|
+
},
|
261
|
+
"file:///C:/FooBar/Baz.txt",
|
262
|
+
},
|
263
|
+
// case-insensitive scheme
|
264
|
+
{
|
265
|
+
"MaIlTo:webmaster@golang.org",
|
266
|
+
&url.URL{
|
267
|
+
Scheme: "mailto",
|
268
|
+
Opaque: "webmaster@golang.org",
|
269
|
+
},
|
270
|
+
"mailto:webmaster@golang.org",
|
271
|
+
},
|
272
|
+
// Relative path
|
273
|
+
{
|
274
|
+
"a/b/c",
|
275
|
+
&url.URL{
|
276
|
+
Path: "a/b/c",
|
277
|
+
},
|
278
|
+
"a/b/c",
|
279
|
+
},
|
280
|
+
// escaped '?' in username and password
|
281
|
+
{
|
282
|
+
"http://%3Fam:pa%3Fsword@google.com",
|
283
|
+
&url.URL{
|
284
|
+
Scheme: "http",
|
285
|
+
User: url.UserPassword("?am", "pa?sword"),
|
286
|
+
Host: "google.com",
|
287
|
+
},
|
288
|
+
"",
|
289
|
+
},
|
290
|
+
// escaped '?' and '#' in path
|
291
|
+
{
|
292
|
+
"http://example.com/%3F%23",
|
293
|
+
&url.URL{
|
294
|
+
Scheme: "http",
|
295
|
+
Host: "example.com",
|
296
|
+
Path: "?#",
|
297
|
+
},
|
298
|
+
"",
|
299
|
+
},
|
300
|
+
// unescaped [ ] ! ' ( ) * in path
|
301
|
+
{
|
302
|
+
"http://example.com/[]!'()*",
|
303
|
+
&url.URL{
|
304
|
+
Scheme: "http",
|
305
|
+
Host: "example.com",
|
306
|
+
Path: "[]!'()*",
|
307
|
+
},
|
308
|
+
"http://example.com/[]!'()*",
|
309
|
+
},
|
310
|
+
// escaped : / ? # [ ] @ in username and password
|
311
|
+
{
|
312
|
+
"http://%3A%2F%3F:%23%5B%5D%40@example.com",
|
313
|
+
&url.URL{
|
314
|
+
Scheme: "http",
|
315
|
+
User: url.UserPassword(":/?", "#[]@"),
|
316
|
+
Host: "example.com",
|
317
|
+
},
|
318
|
+
"",
|
319
|
+
},
|
320
|
+
// unescaped ! $ & ' ( ) * + , ; = in username and password
|
321
|
+
{
|
322
|
+
"http://!$&'():*+,;=@example.com",
|
323
|
+
&url.URL{
|
324
|
+
Scheme: "http",
|
325
|
+
User: url.UserPassword("!$&'()", "*+,;="),
|
326
|
+
Host: "example.com",
|
327
|
+
},
|
328
|
+
"",
|
329
|
+
},
|
330
|
+
// unescaped = : / . ? = in query component
|
331
|
+
{
|
332
|
+
"http://example.com/?q=http://google.com/?q=",
|
333
|
+
&url.URL{
|
334
|
+
Scheme: "http",
|
335
|
+
Host: "example.com",
|
336
|
+
Path: "/",
|
337
|
+
RawQuery: "q=http://google.com/?q=",
|
338
|
+
},
|
339
|
+
"",
|
340
|
+
},
|
341
|
+
// unescaped : / ? [ ] @ ! $ & ' ( ) * + , ; = in fragment
|
342
|
+
{
|
343
|
+
"http://example.com/#:/?%23[]@!$&'()*+,;=",
|
344
|
+
&url.URL{
|
345
|
+
Scheme: "http",
|
346
|
+
Host: "example.com",
|
347
|
+
Path: "/",
|
348
|
+
Fragment: ":/?#[]@!$&'()*+,;=",
|
349
|
+
},
|
350
|
+
"",
|
351
|
+
},
|
352
|
+
}
|
353
|
+
|
354
|
+
func DoTestString(t *testing.T, parse func(string) (*url.URL, error), name string, tests []URLTest) {
|
355
|
+
for _, tt := range tests {
|
356
|
+
u, err := parse(tt.in)
|
357
|
+
if err != nil {
|
358
|
+
t.Errorf("%s(%q) returned error %s", name, tt.in, err)
|
359
|
+
continue
|
360
|
+
}
|
361
|
+
expected := tt.in
|
362
|
+
if len(tt.roundtrip) > 0 {
|
363
|
+
expected = tt.roundtrip
|
364
|
+
}
|
365
|
+
s := Escape(u)
|
366
|
+
if s != expected {
|
367
|
+
t.Errorf("Escape(%s(%q)) == %q (expected %q)", name, tt.in, s, expected)
|
368
|
+
}
|
369
|
+
}
|
370
|
+
}
|
371
|
+
|
372
|
+
func TestURLString(t *testing.T) {
|
373
|
+
DoTestString(t, url.Parse, "Parse", urltests)
|
374
|
+
|
375
|
+
// no leading slash on path should prepend
|
376
|
+
// slash on String() call
|
377
|
+
noslash := URLTest{
|
378
|
+
"http://www.google.com/search",
|
379
|
+
&url.URL{
|
380
|
+
Scheme: "http",
|
381
|
+
Host: "www.google.com",
|
382
|
+
Path: "search",
|
383
|
+
},
|
384
|
+
"",
|
385
|
+
}
|
386
|
+
s := Escape(noslash.out)
|
387
|
+
if s != noslash.in {
|
388
|
+
t.Errorf("Expected %s; go %s", noslash.in, s)
|
389
|
+
}
|
390
|
+
}
|
391
|
+
|
392
|
+
type EscapeTest struct {
|
393
|
+
in string
|
394
|
+
out string
|
395
|
+
err error
|
396
|
+
}
|
397
|
+
|
398
|
+
var escapeTests = []EscapeTest{
|
399
|
+
{
|
400
|
+
"",
|
401
|
+
"",
|
402
|
+
nil,
|
403
|
+
},
|
404
|
+
{
|
405
|
+
"abc",
|
406
|
+
"abc",
|
407
|
+
nil,
|
408
|
+
},
|
409
|
+
{
|
410
|
+
"one two",
|
411
|
+
"one+two",
|
412
|
+
nil,
|
413
|
+
},
|
414
|
+
{
|
415
|
+
"10%",
|
416
|
+
"10%25",
|
417
|
+
nil,
|
418
|
+
},
|
419
|
+
{
|
420
|
+
" ?&=#+%!<>#\"{}|\\^[]`☺\t:/@$'()*,;",
|
421
|
+
"+?%26%3D%23%2B%25%21%3C%3E%23%22%7B%7D%7C%5C%5E%5B%5D%60%E2%98%BA%09%3A/%40%24%27%28%29%2A%2C%3B",
|
422
|
+
nil,
|
423
|
+
},
|
424
|
+
}
|
425
|
+
|
426
|
+
func TestEscape(t *testing.T) {
|
427
|
+
for _, tt := range escapeTests {
|
428
|
+
actual := QueryEscape(tt.in)
|
429
|
+
if tt.out != actual {
|
430
|
+
t.Errorf("QueryEscape(%q) = %q, want %q", tt.in, actual, tt.out)
|
431
|
+
}
|
432
|
+
|
433
|
+
// for bonus points, verify that escape:unescape is an identity.
|
434
|
+
roundtrip, err := url.QueryUnescape(actual)
|
435
|
+
if roundtrip != tt.in || err != nil {
|
436
|
+
t.Errorf("QueryUnescape(%q) = %q, %s; want %q, %s", actual, roundtrip, err, tt.in, "[no error]")
|
437
|
+
}
|
438
|
+
}
|
439
|
+
}
|
440
|
+
|
441
|
+
var resolveReferenceTests = []struct {
|
442
|
+
base, rel, expected string
|
443
|
+
}{
|
444
|
+
// Absolute URL references
|
445
|
+
{"http://foo.com?a=b", "https://bar.com/", "https://bar.com/"},
|
446
|
+
{"http://foo.com/", "https://bar.com/?a=b", "https://bar.com/?a=b"},
|
447
|
+
{"http://foo.com/bar", "mailto:foo@example.com", "mailto:foo@example.com"},
|
448
|
+
|
449
|
+
// Path-absolute references
|
450
|
+
{"http://foo.com/bar", "/baz", "http://foo.com/baz"},
|
451
|
+
{"http://foo.com/bar?a=b#f", "/baz", "http://foo.com/baz"},
|
452
|
+
{"http://foo.com/bar?a=b", "/baz?c=d", "http://foo.com/baz?c=d"},
|
453
|
+
|
454
|
+
// Scheme-relative
|
455
|
+
{"https://foo.com/bar?a=b", "//bar.com/quux", "https://bar.com/quux"},
|
456
|
+
|
457
|
+
// Path-relative references:
|
458
|
+
|
459
|
+
// ... current directory
|
460
|
+
{"http://foo.com", ".", "http://foo.com/"},
|
461
|
+
{"http://foo.com/bar", ".", "http://foo.com/"},
|
462
|
+
{"http://foo.com/bar/", ".", "http://foo.com/bar/"},
|
463
|
+
|
464
|
+
// ... going down
|
465
|
+
{"http://foo.com", "bar", "http://foo.com/bar"},
|
466
|
+
{"http://foo.com/", "bar", "http://foo.com/bar"},
|
467
|
+
{"http://foo.com/bar/baz", "quux", "http://foo.com/bar/quux"},
|
468
|
+
|
469
|
+
// ... going up
|
470
|
+
{"http://foo.com/bar/baz", "../quux", "http://foo.com/quux"},
|
471
|
+
{"http://foo.com/bar/baz", "../../../../../quux", "http://foo.com/quux"},
|
472
|
+
{"http://foo.com/bar", "..", "http://foo.com/"},
|
473
|
+
{"http://foo.com/bar/baz", "./..", "http://foo.com/"},
|
474
|
+
// ".." in the middle (issue 3560)
|
475
|
+
{"http://foo.com/bar/baz", "quux/dotdot/../tail", "http://foo.com/bar/quux/tail"},
|
476
|
+
{"http://foo.com/bar/baz", "quux/./dotdot/../tail", "http://foo.com/bar/quux/tail"},
|
477
|
+
{"http://foo.com/bar/baz", "quux/./dotdot/.././tail", "http://foo.com/bar/quux/tail"},
|
478
|
+
{"http://foo.com/bar/baz", "quux/./dotdot/./../tail", "http://foo.com/bar/quux/tail"},
|
479
|
+
{"http://foo.com/bar/baz", "quux/./dotdot/dotdot/././../../tail", "http://foo.com/bar/quux/tail"},
|
480
|
+
{"http://foo.com/bar/baz", "quux/./dotdot/dotdot/./.././../tail", "http://foo.com/bar/quux/tail"},
|
481
|
+
{"http://foo.com/bar/baz", "quux/./dotdot/dotdot/dotdot/./../../.././././tail", "http://foo.com/bar/quux/tail"},
|
482
|
+
{"http://foo.com/bar/baz", "quux/./dotdot/../dotdot/../dot/./tail/..", "http://foo.com/bar/quux/dot/"},
|
483
|
+
|
484
|
+
// Remove any dot-segments prior to forming the target URI.
|
485
|
+
// http://tools.ietf.org/html/rfc3986#section-5.2.4
|
486
|
+
{"http://foo.com/dot/./dotdot/../foo/bar", "../baz", "http://foo.com/dot/baz"},
|
487
|
+
|
488
|
+
// Triple dot isn't special
|
489
|
+
{"http://foo.com/bar", "...", "http://foo.com/..."},
|
490
|
+
|
491
|
+
// Fragment
|
492
|
+
{"http://foo.com/bar", ".#frag", "http://foo.com/#frag"},
|
493
|
+
|
494
|
+
// RFC 3986: Normal Examples
|
495
|
+
// http://tools.ietf.org/html/rfc3986#section-5.4.1
|
496
|
+
{"http://a/b/c/d;p?q", "g:h", "g:h"},
|
497
|
+
{"http://a/b/c/d;p?q", "g", "http://a/b/c/g"},
|
498
|
+
{"http://a/b/c/d;p?q", "./g", "http://a/b/c/g"},
|
499
|
+
{"http://a/b/c/d;p?q", "g/", "http://a/b/c/g/"},
|
500
|
+
{"http://a/b/c/d;p?q", "/g", "http://a/g"},
|
501
|
+
{"http://a/b/c/d;p?q", "//g", "http://g"},
|
502
|
+
{"http://a/b/c/d;p?q", "?y", "http://a/b/c/d;p?y"},
|
503
|
+
{"http://a/b/c/d;p?q", "g?y", "http://a/b/c/g?y"},
|
504
|
+
{"http://a/b/c/d;p?q", "#s", "http://a/b/c/d;p?q#s"},
|
505
|
+
{"http://a/b/c/d;p?q", "g#s", "http://a/b/c/g#s"},
|
506
|
+
{"http://a/b/c/d;p?q", "g?y#s", "http://a/b/c/g?y#s"},
|
507
|
+
{"http://a/b/c/d;p?q", ";x", "http://a/b/c/;x"},
|
508
|
+
{"http://a/b/c/d;p?q", "g;x", "http://a/b/c/g;x"},
|
509
|
+
{"http://a/b/c/d;p?q", "g;x?y#s", "http://a/b/c/g;x?y#s"},
|
510
|
+
{"http://a/b/c/d;p?q", "", "http://a/b/c/d;p?q"},
|
511
|
+
{"http://a/b/c/d;p?q", ".", "http://a/b/c/"},
|
512
|
+
{"http://a/b/c/d;p?q", "./", "http://a/b/c/"},
|
513
|
+
{"http://a/b/c/d;p?q", "..", "http://a/b/"},
|
514
|
+
{"http://a/b/c/d;p?q", "../", "http://a/b/"},
|
515
|
+
{"http://a/b/c/d;p?q", "../g", "http://a/b/g"},
|
516
|
+
{"http://a/b/c/d;p?q", "../..", "http://a/"},
|
517
|
+
{"http://a/b/c/d;p?q", "../../", "http://a/"},
|
518
|
+
{"http://a/b/c/d;p?q", "../../g", "http://a/g"},
|
519
|
+
|
520
|
+
// RFC 3986: Abnormal Examples
|
521
|
+
// http://tools.ietf.org/html/rfc3986#section-5.4.2
|
522
|
+
{"http://a/b/c/d;p?q", "../../../g", "http://a/g"},
|
523
|
+
{"http://a/b/c/d;p?q", "../../../../g", "http://a/g"},
|
524
|
+
{"http://a/b/c/d;p?q", "/./g", "http://a/g"},
|
525
|
+
{"http://a/b/c/d;p?q", "/../g", "http://a/g"},
|
526
|
+
{"http://a/b/c/d;p?q", "g.", "http://a/b/c/g."},
|
527
|
+
{"http://a/b/c/d;p?q", ".g", "http://a/b/c/.g"},
|
528
|
+
{"http://a/b/c/d;p?q", "g..", "http://a/b/c/g.."},
|
529
|
+
{"http://a/b/c/d;p?q", "..g", "http://a/b/c/..g"},
|
530
|
+
{"http://a/b/c/d;p?q", "./../g", "http://a/b/g"},
|
531
|
+
{"http://a/b/c/d;p?q", "./g/.", "http://a/b/c/g/"},
|
532
|
+
{"http://a/b/c/d;p?q", "g/./h", "http://a/b/c/g/h"},
|
533
|
+
{"http://a/b/c/d;p?q", "g/../h", "http://a/b/c/h"},
|
534
|
+
{"http://a/b/c/d;p?q", "g;x=1/./y", "http://a/b/c/g;x=1/y"},
|
535
|
+
{"http://a/b/c/d;p?q", "g;x=1/../y", "http://a/b/c/y"},
|
536
|
+
{"http://a/b/c/d;p?q", "g?y/./x", "http://a/b/c/g?y/./x"},
|
537
|
+
{"http://a/b/c/d;p?q", "g?y/../x", "http://a/b/c/g?y/../x"},
|
538
|
+
{"http://a/b/c/d;p?q", "g#s/./x", "http://a/b/c/g#s/./x"},
|
539
|
+
{"http://a/b/c/d;p?q", "g#s/../x", "http://a/b/c/g#s/../x"},
|
540
|
+
|
541
|
+
// Extras.
|
542
|
+
{"https://a/b/c/d;p?q", "//g?q", "https://g?q"},
|
543
|
+
{"https://a/b/c/d;p?q", "//g#s", "https://g#s"},
|
544
|
+
{"https://a/b/c/d;p?q", "//g/d/e/f?y#s", "https://g/d/e/f?y#s"},
|
545
|
+
{"https://a/b/c/d;p#s", "?y", "https://a/b/c/d;p?y"},
|
546
|
+
{"https://a/b/c/d;p?q#s", "?y", "https://a/b/c/d;p?y"},
|
547
|
+
}
|
548
|
+
|
549
|
+
func TestResolveReference(t *testing.T) {
|
550
|
+
mustParse := func(url_ string) *url.URL {
|
551
|
+
u, err := url.Parse(url_)
|
552
|
+
if err != nil {
|
553
|
+
t.Fatalf("Expected URL to parse: %q, got error: %v", url_, err)
|
554
|
+
}
|
555
|
+
return u
|
556
|
+
}
|
557
|
+
opaque := &url.URL{Scheme: "scheme", Opaque: "opaque"}
|
558
|
+
for _, test := range resolveReferenceTests {
|
559
|
+
base := mustParse(test.base)
|
560
|
+
rel := mustParse(test.rel)
|
561
|
+
url := base.ResolveReference(rel)
|
562
|
+
if Escape(url) != test.expected {
|
563
|
+
t.Errorf("URL(%q).ResolveReference(%q) == %q, got %q", test.base, test.rel, test.expected, Escape(url))
|
564
|
+
}
|
565
|
+
// Ensure that new instances are returned.
|
566
|
+
if base == url {
|
567
|
+
t.Errorf("Expected URL.ResolveReference to return new URL instance.")
|
568
|
+
}
|
569
|
+
// Test the convenience wrapper too.
|
570
|
+
url, err := base.Parse(test.rel)
|
571
|
+
if err != nil {
|
572
|
+
t.Errorf("URL(%q).Parse(%q) failed: %v", test.base, test.rel, err)
|
573
|
+
} else if Escape(url) != test.expected {
|
574
|
+
t.Errorf("URL(%q).Parse(%q) == %q, got %q", test.base, test.rel, test.expected, Escape(url))
|
575
|
+
} else if base == url {
|
576
|
+
// Ensure that new instances are returned for the wrapper too.
|
577
|
+
t.Errorf("Expected URL.Parse to return new URL instance.")
|
578
|
+
}
|
579
|
+
// Ensure Opaque resets the URL.
|
580
|
+
url = base.ResolveReference(opaque)
|
581
|
+
if *url != *opaque {
|
582
|
+
t.Errorf("ResolveReference failed to resolve opaque URL: want %#v, got %#v", url, opaque)
|
583
|
+
}
|
584
|
+
// Test the convenience wrapper with an opaque URL too.
|
585
|
+
url, err = base.Parse("scheme:opaque")
|
586
|
+
if err != nil {
|
587
|
+
t.Errorf(`URL(%q).Parse("scheme:opaque") failed: %v`, test.base, err)
|
588
|
+
} else if *url != *opaque {
|
589
|
+
t.Errorf("Parse failed to resolve opaque URL: want %#v, got %#v", url, opaque)
|
590
|
+
} else if base == url {
|
591
|
+
// Ensure that new instances are returned, again.
|
592
|
+
t.Errorf("Expected URL.Parse to return new URL instance.")
|
593
|
+
}
|
594
|
+
}
|
595
|
+
}
|
596
|
+
|
597
|
+
type shouldEscapeTest struct {
|
598
|
+
in byte
|
599
|
+
mode encoding
|
600
|
+
escape bool
|
601
|
+
}
|
602
|
+
|
603
|
+
var shouldEscapeTests = []shouldEscapeTest{
|
604
|
+
// Unreserved characters (§2.3)
|
605
|
+
{'a', encodePath, false},
|
606
|
+
{'a', encodeUserPassword, false},
|
607
|
+
{'a', encodeQueryComponent, false},
|
608
|
+
{'a', encodeFragment, false},
|
609
|
+
{'z', encodePath, false},
|
610
|
+
{'A', encodePath, false},
|
611
|
+
{'Z', encodePath, false},
|
612
|
+
{'0', encodePath, false},
|
613
|
+
{'9', encodePath, false},
|
614
|
+
{'-', encodePath, false},
|
615
|
+
{'-', encodeUserPassword, false},
|
616
|
+
{'-', encodeQueryComponent, false},
|
617
|
+
{'-', encodeFragment, false},
|
618
|
+
{'.', encodePath, false},
|
619
|
+
{'_', encodePath, false},
|
620
|
+
{'~', encodePath, false},
|
621
|
+
|
622
|
+
// User information (§3.2.1)
|
623
|
+
{':', encodeUserPassword, true},
|
624
|
+
{'/', encodeUserPassword, true},
|
625
|
+
{'?', encodeUserPassword, true},
|
626
|
+
{'@', encodeUserPassword, true},
|
627
|
+
{'$', encodeUserPassword, false},
|
628
|
+
{'&', encodeUserPassword, false},
|
629
|
+
{'+', encodeUserPassword, false},
|
630
|
+
{',', encodeUserPassword, false},
|
631
|
+
{';', encodeUserPassword, false},
|
632
|
+
{'=', encodeUserPassword, false},
|
633
|
+
}
|
634
|
+
|
635
|
+
func TestShouldEscape(t *testing.T) {
|
636
|
+
for _, tt := range shouldEscapeTests {
|
637
|
+
if shouldEscape(tt.in, tt.mode) != tt.escape {
|
638
|
+
t.Errorf("shouldEscape(%q, %v) returned %v; expected %v", tt.in, tt.mode, !tt.escape, tt.escape)
|
639
|
+
}
|
640
|
+
}
|
641
|
+
}
|