Skip to content

Commit 19c7548

Browse files
fix: revert auth header parsing. Requires stricter allowed domains for CORs
1 parent 2f36946 commit 19c7548

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/SearchAPI/application/application.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ async def file_to_wkt(files: list[UploadFile]):
228228
)
229229

230230
@router.get('/services/utils/kml_footprint')
231-
async def kml_to_footprint(request: Request, granule: str, maturity: str = 'prod'):
231+
async def kml_to_footprint(granule: str, cmr_token: Optional[str] = None, maturity: str = 'prod'):
232232
config = load_config_maturity(maturity=maturity)
233233

234234
query_opts = asf.ASFSearchOptions(granule_list=[granule])
235-
if (auth:=request.headers.get('authorization')) is not None:
235+
if (cmr_token) is not None:
236236
session = SearchAPISession()
237-
session.headers.update({'Authorization': auth})
237+
session.headers.update({'Authorization': f'Bearer {cmr_token}'})
238238
query_opts.session = session
239239

240240

0 commit comments

Comments
 (0)