mirror of
https://github.com/gogs/gogs.git
synced 2026-06-03 14:44:59 +02:00
Co-authored-by: JSS <jss@unknwon.dev> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
7 lines
194 B
Go
7 lines
194 B
Go
package urlx
|
|
|
|
// IsSameSite returns true if the URL path belongs to the same site.
|
|
func IsSameSite(url string) bool {
|
|
return len(url) >= 2 && url[0] == '/' && url[1] != '/' && url[1] != '\\'
|
|
}
|