Server: reorganize some http logic (#5939)

* refactor static file handler

* use set_pre_routing_handler for validate_api_key

* merge embedding handlers

* correct http verb for endpoints

* fix embedding response

* fix test case CORS Options

* fix code style
This commit is contained in:
Xuan Son Nguyen 2024-03-09 11:27:53 +01:00 committed by GitHub
parent e1fa9569ba
commit 950ba1ab84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 379 additions and 358 deletions

View file

@ -39,8 +39,9 @@ Feature: Security
Scenario Outline: CORS Options
When an OPTIONS request is sent from <origin>
Then CORS header <cors_header> is set to <cors_header_value>
Given a user api key llama.cpp
When an OPTIONS request is sent from <origin>
Then CORS header <cors_header> is set to <cors_header_value>
Examples: Headers
| origin | cors_header | cors_header_value |