Use a custom header for branches
This commit is contained in:
parent
6082683996
commit
22870cf023
3
index.ts
3
index.ts
|
@ -15,6 +15,7 @@ const base64 = Buffer.from(
|
|||
|
||||
app.post("/", (req, res) => {
|
||||
const header = req.header("authorization");
|
||||
const branch = req.header("x-branch");
|
||||
|
||||
if (header == null) {
|
||||
res.status(403).send("Authorization header is needed");
|
||||
|
@ -38,7 +39,7 @@ app.post("/", (req, res) => {
|
|||
return;
|
||||
}
|
||||
|
||||
res.send(updateWebsite("main"));
|
||||
res.send(updateWebsite(branch ?? "main"));
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
|
|
Loading…
Reference in New Issue