Fix CORS for /health endpoint

This commit is contained in:
cosmo 2024-04-25 04:59:29 +00:00 committed by GitHub
parent 784e11dea1
commit 0e51cc38cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3110,6 +3110,7 @@ int main(int argc, char ** argv) {
//
const auto handle_health = [&](const httplib::Request & req, httplib::Response & res) {
res.set_header("Access-Control-Allow-Origin", req.get_header_value("Origin"));
server_state current_state = state.load();
switch (current_state) {
case SERVER_STATE_READY: