aboutsummaryrefslogtreecommitdiff
path: root/lib/handlers/compile.js
diff options
context:
space:
mode:
authorPatrick Quist <partouf@gmail.com>2022-08-25 21:52:09 +0200
committerGitHub <noreply@github.com>2022-08-25 21:52:09 +0200
commit5b485d36e3708e192b63400d3bc30bb22cf33330 (patch)
treea6db770b803b7b6e82fa7224f331b38b7797f220 /lib/handlers/compile.js
parent098e0abc4dc870278f1ab4c060c420a5999b54b3 (diff)
parent16dca9d307220229b80327ea0998c4cecec9137b (diff)
downloadcompiler-explorer-gh-4023.tar.gz
compiler-explorer-gh-4023.zip
Merge branch 'main' into z88dkgh-4023
Diffstat (limited to 'lib/handlers/compile.js')
-rw-r--r--lib/handlers/compile.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/handlers/compile.js b/lib/handlers/compile.js
index e9b7a0e8c..87632dca6 100644
--- a/lib/handlers/compile.js
+++ b/lib/handlers/compile.js
@@ -338,15 +338,19 @@ export class CompileHandler {
return {source, options, backendOptions, filters, bypassCache, tools, executionParameters, libraries};
}
- handlePopularArguments(req, res, next) {
+ handlePopularArguments(req, res) {
const compiler = this.compilerFor(req);
- if (!compiler) return next();
+ if (!compiler) {
+ return res.sendStatus(404);
+ }
res.send(compiler.possibleArguments.getPopularArguments(this.getUsedOptions(req)));
}
- handleOptimizationArguments(req, res, next) {
+ handleOptimizationArguments(req, res) {
const compiler = this.compilerFor(req);
- if (!compiler) return next();
+ if (!compiler) {
+ return res.sendStatus(404);
+ }
res.send(compiler.possibleArguments.getOptimizationArguments(this.getUsedOptions(req)));
}
@@ -377,7 +381,7 @@ export class CompileHandler {
handleCmake(req, res, next) {
const compiler = this.compilerFor(req);
if (!compiler) {
- return next();
+ return res.sendStatus(404);
}
const remote = compiler.getRemote();
@@ -413,8 +417,9 @@ export class CompileHandler {
handle(req, res, next) {
const compiler = this.compilerFor(req);
if (!compiler) {
- return next();
+ return res.sendStatus(404);
}
+
const remote = compiler.getRemote();
if (remote) {
req.url = remote.path;