Remove authentication on manifest.json file (and favicon just in case)
This commit is contained in:
parent
1d3ae7c822
commit
b6c0349203
@ -178,8 +178,10 @@ export class HttpServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private addPasswordAuth(app: Application) {
|
private addPasswordAuth(app: Application) {
|
||||||
|
const excludedPaths = ["/manifest.json", "/favicon.png"];
|
||||||
if (this.user) {
|
if (this.user) {
|
||||||
app.use(async ({ request, response }, next) => {
|
app.use(async ({ request, response }, next) => {
|
||||||
|
if (!excludedPaths.includes(request.url.pathname)) {
|
||||||
if (
|
if (
|
||||||
request.headers.get("Authorization") ===
|
request.headers.get("Authorization") ===
|
||||||
`Basic ${btoa(this.user!)}`
|
`Basic ${btoa(this.user!)}`
|
||||||
@ -193,6 +195,10 @@ export class HttpServer {
|
|||||||
);
|
);
|
||||||
response.body = "Unauthorized";
|
response.body = "Unauthorized";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Unauthenticated access to excluded paths
|
||||||
|
await next();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user