browserify / http-browserify

node's http module, but for the browser
MIT License
245 stars 110 forks source link

file://http:// #77

Closed zwhitchcox closed 9 years ago

zwhitchcox commented 9 years ago

When I make this request

{
  host: "http://www.reddit.com/r/jokes/.json?limit=100?",
  path: "/",
  method: "GET",
  withCredentials: false // this is the important part
}

I get this error:

 XMLHttpRequest cannot load file://http://www.reddit.com/r/jokes/.json?limit=100/. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource.

I have no idea why it's prepending "file://" to "http://", and it's totally fucking up my day...

Is there any cure for this?

zwhitchcox commented 9 years ago

Sorry..fixed:

{
  hostname: "www.reddit.com/r/jokes/.json?limit=100",
  path: "/",
  method: "GET",
  withCredentials: false,
  protocol:"http:"
}

The only surefire way for me to immediately find the answer is to ask the world.

Oh well, hopefully someone else will find this useful...