cors 문제 해결 .

This commit is contained in:
HyeongBaeYang committed 2026-06-18 16:30:03 +09:00
1 parent dd03c2aecd
commit b0b787a8ce
6 files changed
+25 -11

No files matched your search

+5 -3
View File
@@ -3,7 +3,7 @@ import json
from typing import Any, Union
from fastapi import Depends
from fastapi.responses import ORJSONResponse
from fastapi.responses import JSONResponse
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
import bcrypt
from jose import jwt, JWTError, ExpiredSignatureError
@@ -109,5 +109,7 @@ def RemoveNoneValues(obj: Any) -> Any:
return obj
def RemoveNoneResponse(obj) -> ORJSONResponse:
return ORJSONResponse(content=RemoveNoneValues(obj.model_dump()))
def RemoveNoneResponse(obj) -> JSONResponse:
# mode="json": datetime/uuid 등을 JSON-safe 문자열로 변환(표준 JSONResponse 가 직렬화 가능).
# (ORJSONResponse 는 최신 FastAPI 에서 deprecated)
return JSONResponse(content=RemoveNoneValues(obj.model_dump(mode="json")))