
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
control-access
Advanced tools
Easy CORS handling
$ npm install control-access
const controlAccess = require('control-access');
module.exports = (req, res) => {
controlAccess()(req, res);
res.end('unicorns');
};
Type: Object
Type: boolean
Access-Control-Allow-Credentials indicates whether or not the response to the request can be exposed when the credentials flag is true.
Can be set globally with the ACCESS_ALLOW_CREDENTIALS environment variable. Possible values are 1 and 0.
Type: Array string
Access-Control-Allow-Headers is used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.
Can be set globally with the ACCESS_ALLOW_HEADERS environment variable using a comma delimited string.
Type: Array string
Access-Control-Allow-Methods specifies the method or methods allowed when accessing the resource.
Can be set globally with the ACCESS_ALLOW_METHODS environment variable using a comma delimited string.
Type: string
Access-Control-Allow-Origin specifies a URI that may access the resource.
Can be set globally with the ACCESS_ALLOW_ORIGIN environment variable.
Type: Array string
Access-Control-Expose-Headers response header indicates which headers can be exposed as part of the response.
Can be set globally with the ACCESS_EXPOSE_HEADERS environment variable using a comma delimited string.
Type: number
Access-Control-Max-Age indicates how long the results of a preflight request can be cached.
Can be set globally with the ACCESS_MAX_AGE environment variable.
Type: http.IncomingMessage
Incoming HTTP request.
Type: http.ServerResponse
Response object.
microMIT © Kevin Mårtensson
FAQs
Easy CORS handling
The npm package control-access receives a total of 8 weekly downloads. As such, control-access popularity was classified as not popular.
We found that control-access demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.