• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

marekdedic / rollup-plugin-htaccess / 9423700726

07 Jun 2024 10:11PM UTC coverage: 31.25% (+8.8%) from 22.449%
9423700726

Pull #3

github

marekdedic
Escaping header expressions
Pull Request #3: Added tests

19 of 75 branches covered (25.33%)

1 of 6 new or added lines in 4 files covered. (16.67%)

4 existing lines in 2 files now uncovered.

30 of 96 relevant lines covered (31.25%)

38.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/headers/XXssProtection.ts
1
import { escapeValue } from "../utils";
2

3
export type XXssProtectionSpec =
4
  | {
5
      mode: "block";
6
    }
7
  | {
8
      mode: "disabled";
9
    }
10
  | {
11
      mode: "sanitize";
12
    }
13
  | {
14
      mode: "sanitize+report";
15
      reportUri: string;
16
    };
17

18
export function buildXXssProtectionValue(spec: XXssProtectionSpec): string {
UNCOV
19
  switch (spec.mode) {
×
20
    case "block":
UNCOV
21
      return "1; mode=block";
×
22
    case "disabled":
NEW
23
      return "0";
×
24
    case "sanitize":
UNCOV
25
      return "1";
×
26
    case "sanitize+report":
27
      return '"1; report=' + escapeValue(spec.reportUri) + '"';
×
28
  }
29
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc