summaryrefslogtreecommitdiff
path: root/src/lib/NetCSP.js
blob: bb6ec61b19b660f280318502e830a5fa735e1063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use strict";

class NetCSP extends CSP {
  constructor(start) {
    super();
    this.start = start;
  }

  isMine(header) {
    let {name, value} = header;
    return name.toLowerCase() === CSP.headerName && value.startsWith(this.start);
  }

  build(...directives) {
    return `${this.start}${super.build(...directives)}`;
  }

  cleanup(headers) {
  }
}