livepeer / livepeer/studio

Improve error handling for CORS error

Open
#1,124 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.