Bug 1666031 - CORS prevents use of REST API
Summary: CORS prevents use of REST API
Keywords:
Status: CLOSED DUPLICATE of bug 1641232
Alias: None
Product: Bugzilla
Classification: Community
Component: WebService
Version: 5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: PnT DevOps Devs
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-14 17:15 UTC by Stephen Finucane
Modified: 2019-01-14 22:34 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-01-14 22:34:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Stephen Finucane 2019-01-14 17:15:37 UTC
Description of problem:
I'm developing a dashboard that consumes data from the new REST API added in BZ5.

  https://github.com/stephenfin/bugzilla-dashboard

However, I'm forced to deploy this application interally (http://file.emea.redhat.com) due to CORS issues. This shouldn't be necessary for a public REST API.

Version-Release number of selected component (if applicable):
N/A

How reproducible:
Always.

Steps to Reproduce:
1. Make an AJAX call to 'https://bugzilla.redhat.com/rest/bug'

Actual results:
I see the following error in my console:

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://bugzilla.redhat.com/rest/bug?component=openstack-nova. (Reason: CORS request did not succeed).

Expected results:
The call should work.

Additional info:
The response should include the following header, allowing users to build tooling that uses the REST API.

    Access-Control-Allow-Origin: *

Comment 1 Stephen Finucane 2019-01-14 17:18:39 UTC
> Additional info:
> The response should include the following header, allowing users to build tooling that uses the REST API.
> 
>     Access-Control-Allow-Origin: *

I should note, in case it wasn't obvious, that we clearly only need this header set for responses from the '/rest' path and subpaths.

Comment 2 Jeff Fearn 🐞 2019-01-14 22:34:51 UTC

*** This bug has been marked as a duplicate of bug 1641232 ***


Note You need to log in before you can comment on or make changes to this bug.