Categorygithub.com/bettercode-oss/gin-middleware-xss
modulepackage
0.0.2
Repository: https://github.com/bettercode-oss/gin-middleware-xss.git
Documentation: pkg.go.dev

# README

Build Status codecov GitHub go.mod Go version GitHub release (latest SemVer)

XSS(Cross Site Scripting) Gin Middleware

It is a gin middleware that prevents XSS attacks based on bluemonday.

Usage

Start using it

Download and install it:

go get github.com/bettercode-oss/gin-middleware-xss

Import it in your code:

import "github.com/bettercode-oss/gin-middleware-xss"

Example

package main

import (
  "github.com/gin-gonic/gin"
  xss "github.com/bettercode-oss/gin-middleware-xss"
  "net/http"
)

func main() {
  r := gin.Default()
  r..Use(xss.Sanitizer(xss.Config{
		TargetHttpMethods: []string{http.MethodPost, http.MethodPut},
		UrlsToExclude:     []string{"/login"},
	}))
  r.Run()
}

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author