jhiesey / stream-http

Streaming node http in the browser
MIT License
354 stars 62 forks source link

Import fails with CORS #60

Closed ghost closed 7 years ago

ghost commented 8 years ago

My company's web stack uses CORS. Merely importing stream-http causes a request to be made to example.com, which violates CORS and therefore causes the import to fail. In fact, I'm not importing stream-http directly, I'm importing fetch, so I can't simply try/catch the import or anything like that.

The error appears on the line: Failed on xhr.open('GET', global.location.host ? '/' : 'https://example.com') So this is related to the previous issue.

jhiesey commented 8 years ago

Which browser are you seeing this in? That xhr should never actually be sent; it's created only to see what features are provided by the XMLHttpRequest object.

ghost commented 8 years ago

I am using chrome.

On Nov 18, 2016 2:45 PM, "John Hiesey" notifications@github.com wrote:

Which browser are you seeing this in? That xhr should never actually be sent; it's created only to see what features are provided by the XMLHttpRequest object.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jhiesey/stream-http/issues/60#issuecomment-261661974, or mute the thread https://github.com/notifications/unsubscribe-auth/AEe_Xn_MGpuMbzFWHZDHV_ash01bw5yvks5q_iqCgaJpZM4K27tW .

magne4000 commented 7 years ago

Same issue with last version of Chrome, no issue with last version of Firefox.

dominictarr commented 7 years ago

this is throwing for me, when using electron with a content-security-policy https://github.com/ssbc/patchwork/issues/431

ysangkok commented 7 years ago

@jhiesey New Chrome versions will throw even on open. I don't know which version exactly changed this behavior.

All Webpack 1 users are affected by this issue.

rohanprasad commented 7 years ago

Hey, any progress with this issue ?

jhiesey commented 7 years ago

This should be fixed by #61

jhiesey commented 7 years ago

Will be included in version 2.6.0

rohanprasad commented 7 years ago

@jhiesey Thanks for the update. Btw when is the next version going to be released?

jhiesey commented 7 years ago

Should be within the next 24 hours. I'm trying to get the tests to pass, but they're being flaky due to #63