mirror of
https://github.com/simongregorebner/gitea-pages.git
synced 2025-04-21 10:20:03 +02:00
changed way to detemine organization
This commit is contained in:
parent
1418f0e14e
commit
d98f8352bf
@ -122,7 +122,7 @@ func (module GiteaPagesModule) ServeHTTP(writer http.ResponseWriter, request *ht
|
|||||||
// The URL/path looks like http(s)://<organization>.<giteaserver>[:<port>]/<repository>/[/<filepath>]
|
// The URL/path looks like http(s)://<organization>.<giteaserver>[:<port>]/<repository>/[/<filepath>]
|
||||||
|
|
||||||
// extract the organization from the hostname
|
// extract the organization from the hostname
|
||||||
organization = strings.TrimRight(request.Host, ".")
|
organization = strings.Split(request.Host, ".")[0]
|
||||||
|
|
||||||
// Remove a potential "/" prefix and trailing "/" - then split up the path
|
// Remove a potential "/" prefix and trailing "/" - then split up the path
|
||||||
path = strings.TrimSuffix(strings.TrimPrefix(request.URL.Path, "/"), "/")
|
path = strings.TrimSuffix(strings.TrimPrefix(request.URL.Path, "/"), "/")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user