Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 577 Bytes

url_unescape.md

File metadata and controls

26 lines (20 loc) · 577 Bytes

URL Unescape Normalizer

The url-unescape normalizer uses net.url.QueryUnescape to converte each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB.

type Request struct {
  Query string `checkers:"url-unescape"`
}

request := &Request{
  Query: "param1%2Fparam2+%3D+1+%2B+2+%26+3+%2B+4",
}

_, valid := checker.Check(request)
if !valid {
  t.Fail()
}

if request.Query != "param1/param2 = 1 + 2 & 3 + 4" {
  t.Fail()
}

// Outputs:
// param1/param2 = 1 + 2 & 3 + 4
fmt.Println(comment.Body)