Skip to content

Commit 738f13a

Browse files
authored
fix(stac-api): avoid base64 encoding application/geo+json data
1 parent b641f52 commit 738f13a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/stac-api/runtime/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WORKDIR /tmp
55
RUN python -m pip install pip -U
66

77
COPY stac-api/runtime/requirements.txt requirements.txt
8-
RUN python -m pip install -r requirements.txt "mangum>=0.14,<0.15" -t /asset --no-binary pydantic
8+
RUN python -m pip install -r requirements.txt -t /asset --no-binary pydantic
99

1010
RUN mkdir -p /asset/src
1111
COPY stac-api/runtime/src/*.py /asset/

lib/stac-api/runtime/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
stac-fastapi-pgstac>=5.0,<5.1
1+
stac-fastapi-pgstac[awslambda]>=5.0,<5.1
22
starlette-cramjam>=0.4,<0.5

lib/stac-api/runtime/src/handler.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ async def shutdown_event():
3838
print("DB connection closed.")
3939

4040

41-
handler = Mangum(app, lifespan="off")
41+
handler = Mangum(
42+
app,
43+
lifespan="off",
44+
text_mime_types=[
45+
# Avoid base64 encoding any text/* or application/* mime-types
46+
"text/",
47+
"application/"
48+
],
49+
)
4250

4351

4452
if "AWS_EXECUTION_ENV" in os.environ:

0 commit comments

Comments
 (0)