llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

server: fix api CORS preflight error

Open c608345 opened this issue 1 year ago • 1 comments

Add

    // If it's browser preflight, skip validation
    if (req.method == "OPTIONS") {
        return true;
    }
    

to server.cpp middleware_validate_api_key will make API CORS works.

c608345 avatar Apr 08 '24 13:04 c608345

Please submit a PR :)

phymbert avatar Apr 13 '24 09:04 phymbert

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 28 '24 02:05 github-actions[bot]