title: How to detect xss attack in Go and abort request with error
body: <p>I am using <strong>dvwright/xss-mw</strong> middleware in Go to detect xss. This middleware auto remove xss from user submitted input, And request continue with valid response.
  I want to detect xss and if there is any xss script then through a error instead of simply removing xss.</p>
  
  <p>My code is here.</p>
  
  <pre><code>package main
  
  import (
      "github.com/dvwright/xss-mw"
      "github.com/gin-gonic/gin"
      "net/http"
  )
  
  func main() {
      r := gin.Default()
  
      // include as standard middleware
      var xssMdlwr xss.XssMw
      r.Use(xssMdlwr.RemoveXss())
  
      r.GET("/ping", func(c *gin.Context) {
          c.JSON(200, gin.H{
              "message": "pong",
          })
      })
  
  
      type Login struct {
          User     string `form:"user" json:"user" binding:"required"`
          Password string `form:"password" json:"password" binding:"required"`
      }
  
      r.POST("/login", func(c *gin.Context) {
          var json Login
          if c.BindJSON(&amp;json) == nil {
              if json.User == "manu" &amp;&amp; json.Password == "123" {
                  c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
              } else {
                  c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"})
              }
          }
      })
  
  
      r.Run() // listen and serve on 0.0.0.0:8080
  }
  </code></pre>
  
  <p>Please help me out.</p>