server: Bypass API Key validation for WebUI static bundle assets (#21269)
* fix: Bypass API Key validation for static bundle assets * refactor: All bypassed routes in `public_endpoints` * test: Update static assets API Key test
This commit is contained in:
parent
86221cf6da
commit
12dbf1da95
2 changed files with 16 additions and 3 deletions
|
|
@ -143,7 +143,11 @@ bool server_http_context::init(const common_params & params) {
|
|||
"/v1/health",
|
||||
"/models",
|
||||
"/v1/models",
|
||||
"/api/tags"
|
||||
"/api/tags",
|
||||
"/",
|
||||
"/index.html",
|
||||
"/bundle.js",
|
||||
"/bundle.css",
|
||||
};
|
||||
|
||||
// If API key is not set, skip validation
|
||||
|
|
@ -151,8 +155,8 @@ bool server_http_context::init(const common_params & params) {
|
|||
return true;
|
||||
}
|
||||
|
||||
// If path is public or is static file, skip validation
|
||||
if (public_endpoints.find(req.path) != public_endpoints.end() || req.path == "/") {
|
||||
// If path is public or static file, skip validation
|
||||
if (public_endpoints.find(req.path) != public_endpoints.end()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue