__host.header.https.html (2864B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/cookies/resources/cookie-helper.sub.js"></script> 5 <script> 6 ["", "MaxAge=10", "HttpOnly"].forEach(extraParams => { 7 // Without 'secure' 8 set_prefixed_cookie_via_http_test({ 9 prefix: "__Host-", 10 params: "Path=/;" + extraParams, 11 origin: self.origin, 12 shouldExistInDOM: false, 13 shouldExistViaHTTP: false, 14 title: "__Host: Secure origin: Does not set 'Path=/;" + extraParams + "'" 15 }); 16 17 set_prefixed_cookie_via_http_test({ 18 prefix: "__HoSt-", 19 params: "Path=/;" + extraParams, 20 origin: self.origin, 21 shouldExistInDOM: false, 22 shouldExistViaHTTP: false, 23 title: "__HoSt: Secure origin: Does not set 'Path=/;" + extraParams + "'" 24 }); 25 26 // With 'secure' 27 set_prefixed_cookie_via_http_test({ 28 prefix: "__Host-", 29 params: "Secure; Path=/;" + extraParams, 30 origin: self.origin, 31 shouldExistInDOM: true, 32 shouldExistViaHTTP: true, 33 title: "__Host: Secure origin: Does set 'Secure; Path=/;" + extraParams + "'" 34 }); 35 36 set_prefixed_cookie_via_http_test({ 37 prefix: "__HoSt-", 38 params: "Secure; Path=/;" + extraParams, 39 origin: self.origin, 40 shouldExistInDOM: true, 41 shouldExistViaHTTP: true, 42 title: "__HoSt: Secure origin: Does set 'Secure; Path=/;" + extraParams + "'" 43 }); 44 45 // With 'domain' 46 set_prefixed_cookie_via_http_test({ 47 prefix: "__Host-", 48 params: "Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams, 49 origin: self.origin, 50 shouldExistInDOM: false, 51 shouldExistViaHTTP: false, 52 title: "__Host: Secure origin: Does not set 'Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams + "'" 53 }); 54 55 set_prefixed_cookie_via_http_test({ 56 prefix: "__HoSt-", 57 params: "Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams, 58 origin: self.origin, 59 shouldExistInDOM: false, 60 shouldExistViaHTTP: false, 61 title: "__HoSt: Secure origin: Does not set 'Secure; Path=/; Domain=" + document.location.hostname + "; " + extraParams + "'" 62 }); 63 }); 64 65 set_prefixed_cookie_via_http_test({ 66 prefix: "__Host-", 67 params: "Secure; Path=/cookies/resources/list.py", 68 origin: self.origin, 69 shouldExistInDOM: false, 70 shouldExistViaHTTP: false, 71 title: "__Host: Secure origin: Does not set 'Secure; Path=/cookies/resources/list.py'" 72 }); 73 74 set_prefixed_cookie_via_http_test({ 75 prefix: "__HoSt-", 76 params: "Secure; Path=/cookies/resources/list.py", 77 origin: self.origin, 78 shouldExistInDOM: false, 79 shouldExistViaHTTP: false, 80 title: "__HoSt: Secure origin: Does not set 'Secure; Path=/cookies/resources/list.py'" 81 }); 82 </script>