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

broker cross-Origin, OPTIONS method not allowed #142

Closed
j-forster opened this issue Apr 26, 2017 · 3 comments
Closed

broker cross-Origin, OPTIONS method not allowed #142

j-forster opened this issue Apr 26, 2017 · 3 comments
Labels

Comments

@j-forster
Copy link
Member

The broker works very well with curl or in the browser (http://broker.waziup.io), but fetching data from other domains (that are limited to cross-origin security) fails.

For example: My WebApp, which is using the waziup broker, requests (http://broker.waziup.io) using fetch, must schedule an OPTIONS request first, before the main GET request.
However, the OPTIONS request fails:
Request Headers:

OPTIONS /v2/entities HTTP/1.1
Access-Control-Request-Headers: fiware-service,fiware-servicepath
Access-Control-Request-Method: GET
Origin: http://my-domain.com

Response Headers:

HTTP/1.1 405 Method Not Allowed
Allow: POST, GET

The dashboard avoids this conflict using orion.waziup.io.

So should i use orion.waziup.io in general, or are you going to implement the cross-origin functionality for broker.waziup.io? (Or is using the broker with other WebApp not intended?)
Thanks in advance!

@cdupont
Copy link
Contributor

cdupont commented Apr 26, 2017

Hi Johann,
good call.
You're right, Orion doesn't support CORS: telefonicaid/fiware-orion#501
So in Waziup we added a proxy that adds the CORS responses: https://github.com/Waziup/Platform/blob/master/identity/identityproxy.conf#L11
This is documented here: http://www.waziup.io/documentation/api/api-reference/

So yes, you can use http://orion.waziup.io/v1/data/entities from a WebApp.

@cdupont
Copy link
Contributor

cdupont commented May 4, 2017

@j-forster is it resolved?

@j-forster
Copy link
Member Author

Yes, thanks for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants