From 9ef9c8454b7742763d5e4bc1872b63b0f2237187 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Thu, 11 Apr 2024 23:18:51 +0200 Subject: [PATCH] use hyphen for query parameter --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 4f381bb..ef404b9 100644 --- a/src/main.py +++ b/src/main.py @@ -4,7 +4,7 @@ import argparse import json from os.path import exists -from fastapi import FastAPI, Request, HTTPException +from fastapi import FastAPI, Request, HTTPException, Query from fastapi.responses import StreamingResponse from fastapi import status from hypercorn.config import Config @@ -44,7 +44,7 @@ class MinSizePerRequestError(Exception): @api.get('/') -def test_data(api_key: str, size: str, request: Request) -> StreamingResponse: +def test_data(request: Request, size: str, api_key: str = Query(..., alias="api-key")) -> StreamingResponse: try: if api_key not in AUTHORIZED_KEYS: raise HTTPException(