Gathering detailed insights and metrics for superagent-d2l-cors-proxy
Gathering detailed insights and metrics for superagent-d2l-cors-proxy
npm install superagent-d2l-cors-proxy
Typescript
Module System
Node Version
NPM Version
68.9
Supply Chain
83.5
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (88.81%)
HTML (11.19%)
Total Downloads
149,891
Last Day
43
Last Week
226
Last Month
1,131
Last Year
17,021
2 Stars
43 Commits
8 Watching
3 Branches
13 Contributors
Minified
Minified + Gzipped
Latest Version
0.3.0
Package Id
superagent-d2l-cors-proxy@0.3.0
Size
7.14 kB
NPM Version
2.14.9
Node Version
0.12.9
Cumulative downloads
Total Downloads
Last day
4.9%
43
Compared to previous day
Last week
-19%
226
Compared to previous week
Last month
3.3%
1,131
Compared to previous month
Last year
24%
17,021
Compared to previous year
Plugin for superagent which will proxy cross-origin requests (CORS) for browsers which don't support them.
##Why Older versions of IE (specifically IE8 and IE9) do not support making cross-origin requests using the standard XMLHttpRequest object. Instead, they rely on the non-standard, proprietary XDomainRequest.
Quite reasonably, superagent does not support the XDomainRequest object. Also, XDomainRequest also has a bunch of restrictions which are not imposed normally when using CORS. There are plugins for superagent which add support for the XDomainRequest object, but the restrictions still apply.
So we need a better way to make cross-origin requests in all browsers.
##How it works
If no CORS support is detected, this plugin will proxy the request through an IFRAME pointing at a HTML document on the destination host using postMessage. Since CORS doesn't apply to the document on the host, it can complete the actual request without limitations.
##Usage
First, download via NPM:
1npm install superagent-d2l-cors-proxy
Upload the provided index.html
file to your destination host at http://myhost.com/lib/superagent-d2l-cors-proxy/{version}/index.html
.
In your application, use()
the proxy with any requests you're making to the destination host with superagent:
1var request = require('superagent'), 2 corsProxy = require('superagent-d2l-cors-proxy'); 3 4request 5 .get('http://myHost.com/myApp/myFile.json') 6 .use(corsProxy) 7 .end(...);
Important: when making requests to other hosts that shouldn't be proxied, simply omit the use(corsProxy)
from the superagent call.
Contributions are welcome, please submit a pull request!
This repository is configured with EditorConfig rules and contributions should make use of them.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
branch protection is not maximal on development and all release branches
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More