Skip to content

Commit 4dc640a

Browse files
author
Arun Patra
authored
Merge pull request #10 from Reloadly/develop
Security hardening
2 parents 3b18ca1 + 2b44adf commit 4dc640a

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prizemates/http-firewall",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "HTTP Firewall based on Spring Security HttpFirewall",
55
"private": false,
66
"main": "./lib/index.js",

src/demo/demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ app.listen(port, () => {
1717

1818
function firewallOptions(): HttpFirewallOptions {
1919
// Allows traffic from specific hosts only
20-
const allowedHostnamesPredicate = Predicate.of<string>((h) => h.endsWith('example.com')).or(
20+
const allowedHostnamesPredicate = Predicate.of<string>((h) => h === 'www.example.com').or(
2121
Predicate.of<string>((h) => h === 'localhost'),
2222
);
2323

src/strict-http-firewall.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class StrictHttpFirewall {
273273
private readonly allowedHttpMethods: HttpMethod[] = this.createDefaultAllowedHttpMethods();
274274
private readonly allowedHostnames: Predicate<String> = new Predicate<string>((hostName) => true);
275275
private readonly ASSIGNED_AND_NOT_ISO_CONTROL_PATTERN: RegExp = new RegExp(
276-
`[\p{IsAssigned}&&[^\p{IsControl}]]*`,
276+
'[\\p{IsAssigned}&&[^\\p{IsControl}]]*',
277277
'g',
278278
);
279279
private readonly ASSIGNED_AND_NOT_ISO_CONTROL_PREDICATE: Predicate<string> = new Predicate<string>((testName) =>

0 commit comments

Comments
 (0)