()
| 358 | } |
| 359 | |
| 360 | func (s *ClientFeaturesDetectorSuite) TestSetVary() { |
| 361 | testCases := []struct { |
| 362 | name string |
| 363 | config clientfeatures.Config |
| 364 | expected string |
| 365 | }{ |
| 366 | { |
| 367 | name: "AutoWebP_Enabled", |
| 368 | config: clientfeatures.Config{ |
| 369 | AutoWebp: true, |
| 370 | }, |
| 371 | expected: "Accept", |
| 372 | }, |
| 373 | { |
| 374 | name: "EnforceWebP_Enabled", |
| 375 | config: clientfeatures.Config{ |
| 376 | EnforceWebp: true, |
| 377 | }, |
| 378 | expected: "Accept", |
| 379 | }, |
| 380 | { |
| 381 | name: "AutoAvif_Enabled", |
| 382 | config: clientfeatures.Config{ |
| 383 | AutoAvif: true, |
| 384 | }, |
| 385 | expected: "Accept", |
| 386 | }, |
| 387 | { |
| 388 | name: "EnforceAvif_Enabled", |
| 389 | config: clientfeatures.Config{ |
| 390 | EnforceAvif: true, |
| 391 | }, |
| 392 | expected: "Accept", |
| 393 | }, |
| 394 | { |
| 395 | name: "AutoJXL_Enabled", |
| 396 | config: clientfeatures.Config{ |
| 397 | AutoJxl: true, |
| 398 | }, |
| 399 | expected: "Accept", |
| 400 | }, |
| 401 | { |
| 402 | name: "EnforceJXL_Enabled", |
| 403 | config: clientfeatures.Config{ |
| 404 | EnforceJxl: true, |
| 405 | }, |
| 406 | expected: "Accept", |
| 407 | }, |
| 408 | { |
| 409 | name: "EnableClientHints_Enabled", |
| 410 | config: clientfeatures.Config{ |
| 411 | EnableClientHints: true, |
| 412 | }, |
| 413 | expected: "Sec-Ch-Dpr, Dpr, Sec-Ch-Width, Width", |
| 414 | }, |
| 415 | { |
| 416 | name: "Combined", |
| 417 | config: clientfeatures.Config{ |
nothing calls this directly
no test coverage detected