File: prism-hpkp.js

package info (click to toggle)
node-prismjs 1.23.0%2Bdfsg-1%2Bdeb11u2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,212 kB
  • sloc: javascript: 21,927; makefile: 11; sh: 7
file content (20 lines) | stat: -rw-r--r-- 413 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 * Original by Scott Helme.
 *
 * Reference: https://scotthelme.co.uk/hpkp-cheat-sheet/
 */

Prism.languages.hpkp = {
	'directive': {
		pattern: /\b(?:(?:includeSubDomains|preload|strict)(?: |;)|pin-sha256="[a-zA-Z\d+=/]+"|(?:max-age|report-uri)=|report-to )/,
		alias: 'keyword'
	},
	'safe': {
		pattern: /\b\d{7,}\b/,
		alias: 'selector'
	},
	'unsafe': {
		pattern: /\b\d{1,6}\b/,
		alias: 'function'
	}
};