Improve error handling for CORS error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 88
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
As a developer, when I call the API from the front end without enabling CORS access I encounter an error, I want that error message to be descriptive enough that I know how to resolve it.
Change current API error from:
`Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://livepeer.studio/api/asset. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 403`
to `403 Error: API is being called from a front end without allowing CORS access. Please generate a new API key with CORS access allowed`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the API's CORS error handling for requests to /api/asset and trace how the current 403 message is produced. Update the response to match the requested wording and verify that a frontend request without CORS access receives the new 403 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100