https://github.com/danielkov/gin-helmet
HTTP Security middleware for GoLang library Gin, inspired by Helmet for Express
https://github.com/danielkov/gin-helmet
Last synced: about 1 year ago
JSON representation
HTTP Security middleware for GoLang library Gin, inspired by Helmet for Express
- Host: GitHub
- URL: https://github.com/danielkov/gin-helmet
- Owner: danielkov
- License: mit
- Created: 2017-11-07T09:53:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-21T09:25:20.000Z (over 3 years ago)
- Last Synced: 2025-04-08T22:02:01.441Z (about 1 year ago)
- Language: Go
- Size: 9.77 KB
- Stars: 42
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gin Helmet
Security middlewares for Gin (`gin-gonic/gin`) inspired by the popular `helmet` middleware package for Node JS `express` and `koa`.
___
[](https://travis-ci.org/danielkov/gin-helmet)
[](https://coveralls.io/github/danielkov/gin-helmet?branch=master)
[](https://goreportcard.com/report/github.com/danielkov/gin-helmet)
[](https://godoc.org/github.com/danielkov/gin-helmet)
[](http://opensource.org/licenses/MIT)
## Usage
Add the `Default` middleware for basic security measures.
```go
s := gin.New()
s.Use(helmet.Default())
```
You can also add each middleware separately:
```go
s.Use(helmet.NoCache())
```
Those not included in the `Default()` middleware are considered more advanced and require consideration before using.
See the [godoc](https://godoc.org/github.com/danielkov/gin-helmet) for more info and examples.