Core components of the web application. https://write.as
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
344 B

  1. package logger
  2. import (
  3. "regexp"
  4. )
  5. var postReg = regexp.MustCompile("(.*(/|id=))[a-zA-Z0-9]{12,13}(.*)")
  6. var tokenReg = regexp.MustCompile("(.*t=)[a-zA-Z0-9]{32}(.*)")
  7. func ScrubID(uri string) string {
  8. curStr := postReg.ReplaceAllString(uri, "$1[scrubbed]$3")
  9. curStr = tokenReg.ReplaceAllString(curStr, "$1[scrubbed]$2")
  10. return curStr
  11. }