Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev branch to match main #10

Merged
merged 6 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const handle = sequence(
headers: {
...
}
}),
}).handle,
yourOtherHandle
);
```
Expand All @@ -78,9 +78,9 @@ import { securityHeaders } from '@islamzaoui/securekit';
export const handle = securityHeaders({
headers: {
'Access-Control-Allow-Origin': 'https://yoursite.com',
'x-sveltekit-page': null, // this will be deleted
'x-sveltekit-page': null, // this will be deleted from response haeders
},
});
}).handle;
```

## Content Security Policy header
Expand All @@ -98,6 +98,9 @@ your can use `csp` option in `securityHeaders` to set the `Content-Security-Poli
import { securityHeaders } from '@islamzaoui/securekit';

export const handle = securityHeaders({
headers:{
...
},
csp: {
directives: {
'script-src': ["'self'",'https://example.com'],
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
<div class="contents">%sveltekit.body%</div>
</body>
</html>
13 changes: 9 additions & 4 deletions apps/demo/src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ export const handle = securityHeaders({
directives: {
'base-uri': ["'self'"],
'child-src': ["'self'"],
'connect-src': ["'self'", 'ws://localhost:*'],
'connect-src': [
"'self'",
'ws://localhost:*',
'wss://ws-us3.pusher.com',
'https://sockjs-us3.pusher.com'
],
'img-src': ["'self'", 'data:'],
'font-src': ["'self'", 'data:'],
'form-action': ["'self'"],
'frame-ancestors': ["'self'"],
'frame-src': ["'self'"],
'frame-src': ["'self'", 'https://vercel.live'],
'manifest-src': ["'self'"],
'media-src': ["'self'", 'data:'],
'object-src': ["'none'"],
'style-src': ["'self'"],
'style-src': ["'self'", "'unsafe-inline'", 'https://vercel.live'],
'default-src': ["'self'", origin],
'script-src': ["'self'"],
'script-src': ["'self'", 'https://vercel.live'],
'worker-src': ["'self'"]
}
},
Expand Down
7 changes: 7 additions & 0 deletions packages/securekit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @islamzaoui/securekit

## 1.1.0

### Minor Changes

- 85cbb48: Fix issue #7
update library codebase structure

## 1.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/securekit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@islamzaoui/securekit",
"version": "1.0.1",
"version": "1.1.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.mjs",
Expand Down