server: add support for HEAD route on audio mp3

This commit is contained in:
2023-11-10 10:11:02 +01:00
committed by Mathieu Virbel
parent 898d1ffcab
commit 14946921f3
3 changed files with 33 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
import os
from typing import BinaryIO
from fastapi import HTTPException, Request, status
from fastapi import HTTPException, Request, Response, status
from fastapi.responses import StreamingResponse
@@ -57,6 +57,9 @@ def range_requests_response(
),
}
if request.method == "HEAD":
return Response(headers=headers)
if content_disposition:
headers["Content-Disposition"] = content_disposition