Skip to content
This repository was archived by the owner on May 19, 2023. It is now read-only.

Commit 95fc13b

Browse files
committed
Properly check for HTTPS protocol
1 parent 69a0973 commit 95fc13b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func New(config ...Config) fiber.Handler {
8080
if cfg.XFrameOptions != "" {
8181
c.Set(fiber.HeaderXFrameOptions, cfg.XFrameOptions)
8282
}
83-
if c.Secure() && cfg.HSTSMaxAge != 0 {
83+
if c.Protocol() == "https" && cfg.HSTSMaxAge != 0 {
8484
subdomains := ""
8585
if !cfg.HSTSExcludeSubdomains {
8686
subdomains = "; includeSubDomains"

0 commit comments

Comments
 (0)