Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMR-10226: Item search not working in STAC Browser #365

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

dmistry1
Copy link
Collaborator

@dmistry1 dmistry1 commented Oct 28, 2024

What is the feature?

When using Radiant Earth for item search, we are seeing "Network Error". The network tab shows a 301 error for these requests.

The Application Load Balancer (ALB) configuration in our serverless.yml file only specified GET and POST methods for the STAC API endpoints. However, Radiant Earth sends an OPTIONS request as part of the CORS preflight process before making a POST request for item searches. Without handling for the OPTIONS method, these preflight requests were resulting in a 301 redirect, causing the CORS error.

What is the Solution?

Updated the serverless.yml file to include OPTIONS in the list of allowed methods for the ALB event configuration. This change allows the ALB to properly route OPTIONS requests to our Lambda function, which can then respond with the appropriate CORS headers. I deployed my branch to SIT to verify these changes indeed work.

Screenshots from SIT

Screenshot 2024-10-28 at 3 10 37 PM
Screenshot 2024-10-28 at 3 10 35 PM
Screenshot 2024-10-28 at 3 10 18 PM

@dmistry1 dmistry1 merged commit bf75528 into master Oct 28, 2024
5 checks passed
@dmistry1 dmistry1 deleted the CMR-10226 branch October 28, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants