Skip to content

Commit

Permalink
Prepare Cross-Origin-Resource-Policy standalone package
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Apr 17, 2021
1 parent 24fbd90 commit 76f2920
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ app.use(helmet.crossOriginResourcePolicy({ policy: "same-site" }));
app.use(helmet.crossOriginResourcePolicy({ policy: "cross-origin" }));
```

You can't install this module separately.
You can install this module separately as `cross-origin-resource-policy`.

</details>

Expand Down
27 changes: 27 additions & 0 deletions middlewares/cross-origin-resource-policy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

## Unreleased

### Added

- Added support for the `cross-origin` policy

## 0.2.1 - 2020-12-22

### Fixed

- Fixed incorrect example in README

## 0.2.0 - 2019-07-17

### Added

- Added TypeScript type definitions. See [#2](https://github.com/helmetjs/cross-origin-resource-policy/pull/2) and [helmetjs/helmet#188](https://github.com/helmetjs/helmet/issues/188)
- Created a changelog
- Added some additional package metadata: homepage, email for bug reports, and a list of supported Node versions

### Changed

- Excluded some files from npm package

This changelog was started in version 0.2.0.
15 changes: 15 additions & 0 deletions middlewares/cross-origin-resource-policy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Cross-Origin-Resource-Policy middleware

This middleware sets the `Cross-Origin-Resource-Policy` header. Read about it [in the spec](https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header).

Usage:

```javascript
const crossOriginResourcePolicy = require("cross-origin-resource-policy");

// Sets "Cross-Origin-Resource-Policy: same-origin"
app.use(crossOriginResourcePolicy({ policy: "same-origin" }));

// Sets "Cross-Origin-Resource-Policy: same-site"
app.use(crossOriginResourcePolicy({ policy: "same-site" }));
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["index.js", "index.d.ts"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "cross-origin-resource-policy",
"author": "Evan Hahn <[email protected]> (https://evanhahn.com)",
"contributors": [],
"description": "Middleware to set the Cross-Origin-Resource-Policy header",
"version": "0.2.1",
"keywords": ["cross-origin-resource-policy"]
}

0 comments on commit 76f2920

Please sign in to comment.