PHP 7.4.33
Preview: validate-header-value.js Size: 400 B
/usr/share/nodejs/http2-wrapper/source/utils/validate-header-value.js
'use strict';
const {
	ERR_HTTP_INVALID_HEADER_VALUE,
	ERR_INVALID_CHAR
} = require('./errors.js');

const isInvalidHeaderValue = /[^\t\u0020-\u007E\u0080-\u00FF]/;

module.exports = (name, value) => {
	if (typeof value === 'undefined') {
		throw new ERR_HTTP_INVALID_HEADER_VALUE(value, name);
	}

	if (isInvalidHeaderValue.test(value)) {
		throw new ERR_INVALID_CHAR('header content', name);
	}
};

Directory Contents

Dirs: 0 × Files: 10
Name Size Perms Modified Actions
449 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
473 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
652 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
1.45 KB lrw-r--r-- 2021-11-20 15:22:42
Edit Download
186 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
237 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
149 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
2.33 KB lrw-r--r-- 2021-11-20 15:22:42
Edit Download
385 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
400 B lrw-r--r-- 2021-11-20 15:22:42
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).