mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-31 11:52:41 +00:00
ctx: make Secure() also report whether a secure connection was established to a trusted proxy (#2215)
We had a discussion about this in https://github.com/gofiber/helmet/pull/74.
This commit is contained in:
parent
a0645af1ed
commit
b288a9f54e
4
ctx.go
4
ctx.go
@ -1496,9 +1496,9 @@ func (c *Ctx) SaveFileToStorage(fileheader *multipart.FileHeader, path string, s
|
||||
return storage.Set(path, content, 0)
|
||||
}
|
||||
|
||||
// Secure returns a boolean property, that is true, if a TLS connection is established.
|
||||
// Secure returns whether a secure connection was established.
|
||||
func (c *Ctx) Secure() bool {
|
||||
return c.fasthttp.IsTLS()
|
||||
return c.Protocol() == "https"
|
||||
}
|
||||
|
||||
// Send sets the HTTP response body without copying it.
|
||||
|
Loading…
x
Reference in New Issue
Block a user