mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
12 lines
332 B
JavaScript
12 lines
332 B
JavaScript
import { readFileSync } from 'fs';
|
|
import { createServer } from 'http';
|
|
import { parse } from 'url';
|
|
import { join } from 'path';
|
|
|
|
var server = createServer(function(req, res) {
|
|
let path = parse(req.url, true).query.path;
|
|
|
|
// BAD: This could read any file on the file system
|
|
res.write(readFileSync(join("public", path)));
|
|
});
|