summaryrefslogtreecommitdiff
path: root/examples/server/tests/features
diff options
context:
space:
mode:
Diffstat (limited to 'examples/server/tests/features')
-rw-r--r--examples/server/tests/features/security.feature5
-rw-r--r--examples/server/tests/features/steps/steps.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/examples/server/tests/features/security.feature b/examples/server/tests/features/security.feature
index 42a6709a..1d6aa40e 100644
--- a/examples/server/tests/features/security.feature
+++ b/examples/server/tests/features/security.feature
@@ -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 |
diff --git a/examples/server/tests/features/steps/steps.py b/examples/server/tests/features/steps/steps.py
index 0076f805..14204850 100644
--- a/examples/server/tests/features/steps/steps.py
+++ b/examples/server/tests/features/steps/steps.py
@@ -582,8 +582,9 @@ async def step_detokenize(context):
@async_run_until_complete
async def step_options_request(context, origin):
async with aiohttp.ClientSession() as session:
+ headers = {'Authorization': f'Bearer {context.user_api_key}', 'Origin': origin}
async with session.options(f'{context.base_url}/v1/chat/completions',
- headers={"Origin": origin}) as response:
+ headers=headers) as response:
assert response.status == 200
context.options_response = response