func sameOrigin(u1, u2 *url.URL) bool {
	return (u1.Scheme == u2.Scheme && u1.Host == u2.Host)
}
Checks if the given URLs have the same origin
(that is, they share the host, the port and the scheme)
package nosurf
import (
	"net/url"
)
func sContains(slice []string, s string) bool {
	for _, v := range slice {
		if v == s {
			return true
		}
	}
	return false
}