(ver version.Version)
| 61 | } |
| 62 | |
| 63 | func createTestBundleWithVariants(ver version.Version) *Bundle { |
| 64 | primaryURL := urlMustParse("https://variants.example.com/") |
| 65 | return &Bundle{ |
| 66 | Version: ver, |
| 67 | PrimaryURL: primaryURL, |
| 68 | Exchanges: []*Exchange{ |
| 69 | &Exchange{ |
| 70 | Request{URL: primaryURL}, |
| 71 | Response{ |
| 72 | Status: 200, |
| 73 | Header: http.Header{ |
| 74 | "Content-Type": []string{"text/plain"}, |
| 75 | "Variants": []string{"Accept-Language;en;ja"}, |
| 76 | "Variant-Key": []string{"en"}, |
| 77 | }, |
| 78 | Body: []byte("Hello, world!"), |
| 79 | }, |
| 80 | }, |
| 81 | &Exchange{ |
| 82 | Request{URL: primaryURL}, |
| 83 | Response{ |
| 84 | Status: 200, |
| 85 | Header: http.Header{ |
| 86 | "Content-Type": []string{"text/plain"}, |
| 87 | "Variants": []string{"Accept-Language;en;ja"}, |
| 88 | "Variant-Key": []string{"ja"}, |
| 89 | }, |
| 90 | Body: []byte("こんにちは世界"), |
| 91 | }, |
| 92 | }, |
| 93 | }, |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func createTestCerts(t *testing.T) []*certurl.AugmentedCertificate { |
| 98 | certs, err := signingalgorithm.ParseCertificates([]byte(pemCerts)) |
no test coverage detected