Exploit databaseDownload repository ZIP
GH-1a20f837c010c44c4376b2cd46cc5150
fastify/send
Sources for CVE-2017-20165
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files10
fastify/sendRevision 789c51df089e
- ↑..Parent directory
- collapseLeadingSlashes.js
- containsDotFile.js
- contentRange.js
- createHtmlDocument.js
- createHttpError.js
- isUtf8MimeType.js
- normalizeList.js
- parseBytesRange.js
- parseTokenList.js
- send.js
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
lib/createHtmlDocument.js
JavaScript · 633 bytes/*!
* send
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Create a minimal HTML document.
*
* @param {string} title
* @param {string} body
* @private
*/
function createHtmlDocument (title, body) {
const html = '<!DOCTYPE html>\n' +
'<html lang="en">\n' +
'<head>\n' +
'<meta charset="utf-8">\n' +
'<title>' + title + '</title>\n' +
'</head>\n' +
'<body>\n' +
'<pre>' + body + '</pre>\n' +
'</body>\n' +
'</html>\n'
return [html, Buffer.byteLength(html)]
}
exports.createHtmlDocument = createHtmlDocument