Skip to content

Commit

Permalink
test wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-maschler committed Feb 12, 2024
1 parent 9210501 commit 1fa87b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stac_fastapi/api/stac_fastapi/api/routes.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""Route factories."""

import functools
import inspect
from typing import Any, Callable, Dict, List, Optional, Type, TypedDict, Union

from fastapi import Depends, params
from fastapi.dependencies.utils import get_parameterless_sub_dependant
from pydantic import BaseModel
from stac_pydantic.api import LandingPage
from starlette.concurrency import run_in_threadpool
from starlette.requests import Request
from starlette.responses import JSONResponse, Response
Expand All @@ -18,6 +20,8 @@
def _wrap_response(resp: Any, response_class: Type[Response]) -> Response:
if isinstance(resp, Response):
return resp
elif isinstance(resp, LandingPage):
return resp
elif resp is not None:
return response_class(resp)
else: # None is returned as 204 No Content
Expand Down

0 comments on commit 1fa87b7

Please sign in to comment.