-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(utils): add preset for recommended sts value
- Loading branch information
1 parent
7c30b2c
commit c63de41
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2023-latest the httpland authors. All rights reserved. MIT license. | ||
// This module is browser compatible. | ||
|
||
import { StrictTransportSecurity } from "./deps.ts"; | ||
|
||
/** Recommended {@link StrictTransportSecurity}. | ||
* The following hosts are recommended. | ||
* - [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Strict_Transport_Security_Cheat_Sheet.html) | ||
* - [mozilla](https://infosec.mozilla.org/guidelines/web_security#http-strict-transport-security) | ||
* | ||
* @example | ||
* ```http | ||
* Strict-Transport-Security: max-age=63072000; includeSubDomains; preload | ||
* ``` | ||
*/ | ||
export const STS: StrictTransportSecurity = { | ||
maxAge: 60 * 60 * 24 * 365 * 2, | ||
includeSubDomains: true, | ||
preload: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { STS } from "./utils.ts"; | ||
import { assertEquals, describe, it } from "./_dev_deps.ts"; | ||
|
||
describe("STS", () => { | ||
it("should return true", () => { | ||
assertEquals(STS, { | ||
maxAge: 63072000, | ||
preload: true, | ||
includeSubDomains: true, | ||
}); | ||
}); | ||
}); |