interagent / interagent/committee

Handle options requests in order to avoid CORS errors

Open
#83 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
955
Forks
145
Avg merge
5d 4h
Merged PRs (30d)
6

Description

I am currently working on a Node application that is consuming an API I built into a Rails application. I have configured my Rails app to allow POST (also, PUT and DELETE) requests by handling OPTIONS requests that precede them.

Here is the console error I see in Chrome when making the same request against the mock API provided when running committee.

OPTIONS http://localhost:9000/apps/123456/reports
XMLHttpRequest cannot load http://localhost:9000/apps/123456/reports. No 'Access-Control-Allow- Origin' header is present on the requested resource. Origin http://localhost:8080 is therefore not allowed access. The response had HTTP status code 404.

I may find the time to figure this out myself, but I am sure I am not the only person that has run into this issue.

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

Reproduce the failing OPTIONS request against the mock API provided when running committee, using the example URL and origins from the issue. Trace how that request is handled and verify that the response includes the required CORS headers and avoids the reported 404 before allowing the subsequent request.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, rails, ruby
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.