-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from brokenhandsio/vapor3
Vapor 3
- Loading branch information
Showing
18 changed files
with
287 additions
and
328 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
// swift-tools-version:4.0 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "VaporSecurityHeaders", | ||
products: [ | ||
.library(name: "VaporSecurityHeaders", targets: ["VaporSecurityHeaders"]), | ||
], | ||
dependencies: [ | ||
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2), | ||
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"), | ||
], | ||
targets: [ | ||
.target(name: "VaporSecurityHeaders", dependencies: ["Vapor"]), | ||
.testTarget(name: "VaporSecurityHeadersTests", dependencies: ["VaporSecurityHeaders"]), | ||
] | ||
) |
This file was deleted.
Oops, something went wrong.
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
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
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
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
31 changes: 7 additions & 24 deletions
31
Sources/VaporSecurityHeaders/SecurityHeaders+HeaderKey.swift
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 |
---|---|---|
@@ -1,27 +1,10 @@ | ||
import HTTP | ||
import Vapor | ||
|
||
public extension HeaderKey { | ||
static public var contentSecurityPolicy: HeaderKey { | ||
return HeaderKey("content-security-policy") | ||
} | ||
public extension HTTPHeaderName { | ||
|
||
static public var xXssProtection: HeaderKey { | ||
return HeaderKey("x-xss-protection") | ||
} | ||
|
||
static public var xFrameOptions: HeaderKey { | ||
return HeaderKey("x-frame-options") | ||
} | ||
|
||
static public var xContentTypeOptions: HeaderKey { | ||
return HeaderKey("x-content-type-options") | ||
} | ||
|
||
static public var contentSecurityPolicyReportOnly: HeaderKey { | ||
return HeaderKey("content-security-policy-report-only") | ||
} | ||
|
||
static public var referrerPolicy: HeaderKey { | ||
return HeaderKey("referrer-policy") | ||
} | ||
public static let contentSecurityPolicy = HTTPHeaderName("Content-Security-Policy") | ||
public static let xXssProtection = HTTPHeaderName("X-XSS-Protection") | ||
public static let xContentTypeOptions = HTTPHeaderName("X-Content-Type-Options") | ||
public static let contentSecurityPolicyReportOnly = HTTPHeaderName("Content-Security-Policy-Report-Only") | ||
public static let referrerPolicy = HTTPHeaderName("Referrer-Policy") | ||
} |
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
Oops, something went wrong.