|
543 | 543 | expect(subject).to be_valid
|
544 | 544 | end
|
545 | 545 | end
|
| 546 | + |
| 547 | + context "domains with unicode encoding" do |
| 548 | + let(:domain) { "dómain.example.com" } |
| 549 | + let(:cname) { "sómething.example.com" } |
| 550 | + let(:headers) { { :server => "GitHub.com" } } |
| 551 | + before(:each) { allow(subject).to receive(:dns) { [cname_packet] } } |
| 552 | + |
| 553 | + it "doesn't error out on domains with unicode encoding" do |
| 554 | + expect(subject).to be_served_by_pages |
| 555 | + expect(subject).to be_valid |
| 556 | + end |
| 557 | + end |
| 558 | + |
| 559 | + context "domains with punycode encoding" do |
| 560 | + let(:domain) { "xn--dmain-0ta.example.com" } |
| 561 | + let(:cname) { "xn--smething-v3a.example.com" } |
| 562 | + let(:headers) { { :server => "GitHub.com" } } |
| 563 | + before(:each) { allow(subject).to receive(:dns) { [cname_packet] } } |
| 564 | + |
| 565 | + it "doesn't error out on domains with punycode encoding" do |
| 566 | + expect(subject).to be_served_by_pages |
| 567 | + expect(subject).to be_valid |
| 568 | + end |
| 569 | + end |
546 | 570 | end
|
547 | 571 |
|
548 | 572 | context "not served by pages" do
|
|
836 | 860 | context "A records pointed to old IPs" do
|
837 | 861 | let(:ip) { "192.30.252.153" }
|
838 | 862 | before(:each) { allow(subject).to receive(:dns) { [a_packet] } }
|
| 863 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [a_packet] } } |
839 | 864 |
|
840 | 865 | it { is_expected.not_to be_https_eligible }
|
| 866 | + |
| 867 | + context "with unicode encoded domain" do |
| 868 | + let(:domain) { "dómain.example.com" } |
| 869 | + |
| 870 | + it { is_expected.not_to be_https_eligible } |
| 871 | + end |
| 872 | + |
| 873 | + context "with punycode encoded domain" do |
| 874 | + let(:domain) { "xn--dmain-0ta.example.com" } |
| 875 | + |
| 876 | + it { is_expected.not_to be_https_eligible } |
| 877 | + end |
841 | 878 | end
|
842 | 879 |
|
843 | 880 | context "A records pointed to new IPs" do
|
844 | 881 | let(:ip) { "185.199.108.153" }
|
845 | 882 | before(:each) { allow(subject).to receive(:dns) { [a_packet] } }
|
| 883 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [a_packet] } } |
846 | 884 |
|
847 | 885 | it { is_expected.to be_https_eligible }
|
848 | 886 |
|
|
859 | 897 |
|
860 | 898 | it { is_expected.to be_https_eligible }
|
861 | 899 | end
|
| 900 | + |
| 901 | + context "with unicode encoded domain" do |
| 902 | + let(:domain) { "dómain.example.com" } |
| 903 | + |
| 904 | + it { is_expected.to be_https_eligible } |
| 905 | + |
| 906 | + context "with bad CAA records" do |
| 907 | + let(:caa_domain) { "digicert.com" } |
| 908 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 909 | + |
| 910 | + it { is_expected.not_to be_https_eligible } |
| 911 | + end |
| 912 | + |
| 913 | + context "with good CAA records" do |
| 914 | + let(:caa_domain) { "letsencrypt.org" } |
| 915 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 916 | + |
| 917 | + it { is_expected.to be_https_eligible } |
| 918 | + end |
| 919 | + end |
| 920 | + |
| 921 | + context "with punycode encoded domain" do |
| 922 | + let(:domain) { "xn--dmain-0ta.example.com" } |
| 923 | + |
| 924 | + it { is_expected.to be_https_eligible } |
| 925 | + |
| 926 | + context "with bad CAA records" do |
| 927 | + let(:caa_domain) { "digicert.com" } |
| 928 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 929 | + |
| 930 | + it { is_expected.not_to be_https_eligible } |
| 931 | + end |
| 932 | + |
| 933 | + context "with good CAA records" do |
| 934 | + let(:caa_domain) { "letsencrypt.org" } |
| 935 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 936 | + |
| 937 | + it { is_expected.to be_https_eligible } |
| 938 | + end |
| 939 | + end |
862 | 940 | end
|
863 | 941 |
|
864 | 942 | context "CNAME record pointed to username" do
|
865 | 943 | let(:cname) { "foobar.github.io" }
|
866 | 944 | before(:each) { allow(subject).to receive(:dns) { [cname_packet] } }
|
| 945 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [cname_packet] } } |
867 | 946 |
|
868 | 947 | it { is_expected.to be_https_eligible }
|
869 | 948 |
|
|
880 | 959 |
|
881 | 960 | it { is_expected.to be_https_eligible }
|
882 | 961 | end
|
| 962 | + |
| 963 | + context "with unicode encoded domain" do |
| 964 | + let(:domain) { "dómain.example.com" } |
| 965 | + |
| 966 | + it { is_expected.to be_https_eligible } |
| 967 | + |
| 968 | + context "with bad CAA records" do |
| 969 | + let(:caa_domain) { "digicert.com" } |
| 970 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 971 | + |
| 972 | + it { is_expected.not_to be_https_eligible } |
| 973 | + end |
| 974 | + |
| 975 | + context "with good CAA records" do |
| 976 | + let(:caa_domain) { "letsencrypt.org" } |
| 977 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 978 | + |
| 979 | + it { is_expected.to be_https_eligible } |
| 980 | + end |
| 981 | + end |
| 982 | + |
| 983 | + context "with punycode encoded domain" do |
| 984 | + let(:domain) { "xn--dmain-0ta.example.com" } |
| 985 | + |
| 986 | + it { is_expected.to be_https_eligible } |
| 987 | + |
| 988 | + context "with bad CAA records" do |
| 989 | + let(:caa_domain) { "digicert.com" } |
| 990 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 991 | + |
| 992 | + it { is_expected.not_to be_https_eligible } |
| 993 | + end |
| 994 | + |
| 995 | + context "with good CAA records" do |
| 996 | + let(:caa_domain) { "letsencrypt.org" } |
| 997 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [caa_packet] } } |
| 998 | + |
| 999 | + it { is_expected.to be_https_eligible } |
| 1000 | + end |
| 1001 | + end |
883 | 1002 | end
|
884 | 1003 |
|
885 | 1004 | context "CNAME record pointed elsewhere" do
|
886 | 1005 | let(:cname) { "jinglebells.com" }
|
887 | 1006 | before(:each) { allow(subject).to receive(:dns) { [cname_packet] } }
|
| 1007 | + before(:each) { allow(subject.send(:caa)).to receive(:query) { [cname_packet] } } |
888 | 1008 |
|
889 | 1009 | it { is_expected.not_to be_https_eligible }
|
890 | 1010 |
|
|
901 | 1021 |
|
902 | 1022 | it { is_expected.not_to be_https_eligible }
|
903 | 1023 | end
|
| 1024 | + |
| 1025 | + context "with unicode encoded domain" do |
| 1026 | + let(:domain) { "dómain.example.com" } |
| 1027 | + |
| 1028 | + it { is_expected.not_to be_https_eligible } |
| 1029 | + end |
| 1030 | + |
| 1031 | + context "with punycode encoded domain" do |
| 1032 | + let(:domain) { "xn--dmain-0ta.example.com" } |
| 1033 | + |
| 1034 | + it { is_expected.not_to be_https_eligible } |
| 1035 | + end |
904 | 1036 | end
|
905 | 1037 | end
|
906 | 1038 | end
|
0 commit comments