Skip to content

Commit 143cbc9

Browse files
fix: proper response media type set for kml endpoint
1 parent b7b51de commit 143cbc9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/SearchAPI/application/application.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,12 @@ async def kml_to_footprint(granule: str, cmr_token: Optional[str] = None, maturi
245245
kml_file = results.find_urls(extension='.kml')[0]
246246

247247
kml_response = query_opts.session.get(kml_file)
248-
return kml_response.text.strip('"')
248+
return Response(
249+
content=str(kml_response.text),
250+
status_code=200,
251+
media_type='text/html; charset=utf-8',
252+
headers=constants.DEFAULT_HEADERS
253+
)
249254

250255
# example: https://api.daac.asf.alaska.edu/services/redirect/NISAR_L2_STATIC/{granule_id}.h5
251256
# @router.get('/services/redirect/{short_name}/{granule_id}')

0 commit comments

Comments
 (0)