mirror of
https://github.com/harness/drone.git
synced 2025-05-05 13:41:38 +08:00

Adds the basic for harness embedded mode: - Harness dedicated router with custom APIHandler - Inline Space Creation - Client for Account/Org/Project - Bootstrap (Allows for automated creation of admin user and gitness service (used for all platform required ops)) - Inline harness service principal creation - Ignore flag for ACL.
23 lines
369 B
Go
23 lines
369 B
Go
package request
|
|
|
|
import (
|
|
"net/http"
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
const (
|
|
PathParamRepoRef = "repositoryRef"
|
|
)
|
|
|
|
func GetRepoRefFromPath(r *http.Request) (string, error) {
|
|
rawRef, err := PathParamOrError(r, PathParamRepoRef)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
// paths are unescaped and lower
|
|
ref, err := url.PathUnescape(rawRef)
|
|
return strings.ToLower(ref), err
|
|
}
|