Skip to content

Commit

Permalink
Network access works - disable creds in XHR for wildcarded CORS proxies
Browse files Browse the repository at this point in the history
You can now do things like:

npm.commands.view(['voxel-engine'])

and your browser will fetch information from the NPM registry,
via the CORS proxy.

Closes GH-1
Ref voxel/voxel-plugins#1
  • Loading branch information
deathcap committed Feb 10, 2015
1 parent 944d03d commit dadbf7d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ var textReplacements = [

// npm/node_modules/npm-registry-client/index.js
[/client\[name\] = require\(entry\)/g, 'client[name] = window.npmRegistryClientRequire(entry)'],

// node_modules/npm/node_modules/request somewhere
// Disable credentials in XHR for CORS proxies with Access-Control-Allow-Origin: *
// TODO: surely a better way to make this change
[/params.withCredentials = true/g, 'params.withCredentials = false'],
];

// Included file data for staticReadFileSync; this is similar to
Expand Down

0 comments on commit dadbf7d

Please sign in to comment.