Download tasks/codeql_javascript_benchmark_top30_v1/morefixes-04314885419e817d3b17/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_javascript_benchmark_top30_v1/morefixes-04314885419e817d3b17/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_javascript_benchmark_top30_v1/morefixes-04314885419e817d3b17/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_javascript_benchmark_top30_v1/morefixes-04314885419e817d3b17/patch.diff
1.1 kB
| diff --git a/app.js b/app.js | |
| index b935306d5..34a4e1a72 100644 | |
| --- a/app.js | |
| +++ b/app.js | |
| app.use(cookieParser()) | |
| app.use(i18n.init) | |
| // routes without sessions | |
| +// security headers for uploads | |
| +app.use('/uploads', (req, res, next) => { | |
| + res.set('Content-Disposition', 'attachment') | |
| + res.set('Content-Security-Policy', "default-src 'none'") | |
| + next() | |
| +}) | |
| + | |
| // static files | |
| app.use('/', express.static(path.join(__dirname, '/public'), { | |
| maxAge: config.staticCacheTime, | |
| app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { | |
| maxAge: config.staticCacheTime, | |
| redirect: false | |
| })) | |
| -// This is done by an additional middleware, instead of setHeaders of express.static, because for what ever reason | |
| -// the latter did not work | |
| -app.use('/uploads', (req, res, next) => { | |
| - res.set('Content-Disposition', 'attachment') | |
| - res.set('Content-Security-Policy', "default-src 'none'") | |
| - next() | |
| -}) | |
| app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { | |
| maxAge: config.staticCacheTime, | |
| redirect: false | |