CORS issue when using meteor
See original GitHub issueI am following the documented steps for getting started and everything went well until the “Retrieving Activities” step.
Running
import stream from 'getstream' // stream-js v3.5.0
const client = stream.connect(APP_KEY, null, APP_ID, { location: 'eu-west' });
const user1 = client.feed('user', '1', READ_ONLY_TOKEN);
user1.get({ limit:5, offset:5 })
.catch((errorData) => {
console.log(errorData);
});
gives me
{
error: undefined,
response: {
statusCode: 0,
request: {
uri: {
protocol: "https:",
slashes: true,
auth: null,
host: "api.getstream.io",
port: null,
hostname: "api.getstream.io",
hash: null,
search: "?limit=5&offset=5&api_key=...secret...&location=unspecified",
query: "limit=5&offset=5&api_key=...secret...&location=unspecified",
pathname: "/api/v1.0/feed/global/global/",
path: "/api/v1.0/feed/global/global/?limit=5&offset=5&api_key=...secret...&location=unspecified",
href: "https://api.getstream.io/api/v1.0/feed/global/global/?limit=5&offset=5&api_key=...secret...&location=unspecified"
},
method: "GET",
headers: {
stream - auth - type: "jwt",
Authorization: "...secret...",
["X-Stream-Client"]: "stream-javascript-client-browser-unknown",
accept: "application/json"
}
}
}
}
Any suggestion of what I could try here?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to fix CORS ('Access-Control-Allow-Origin') error in ...
The best way to solve this is to move your remote API consumption code to the server, and create a Meteor method to...
Read more >CORS on Meteor - enable cross-origin resource sharing
To add CORS authorization to a Meteor application, use the webapp package's WebApp.connectHandlers to customize HTTP headers. In order for Meteor APIs to ......
Read more >How to add CORS headers to a Meteor app? - Stack Overflow
How it is possible to add Access-Control-Allow-Origin: * header to all responses (in particular, I am interested for static files under /public/ )...
Read more >communitypackages:fast-render - Packosphere
You can use Meteor.subscribe in your React containers and the data will ... app adds CORS headers via connect handlers, there is a...
Read more >Solved: REST API CORS block - Anaplan Community
Solved: Hi I can successfully connect to Anaplan using Postman. ... I did a try in Meteor.js and my requests are actually going...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I merged it into master, you can use install from there for now until it is released.
I found out the problem. Meteor has its own browser fallback for the request lib that has a different default for withCredentials. This overrides the request browser library that I mentioned before. PR #100 should fix this by setting withCredentials explicitly.