mirror of
https://github.com/harness/drone.git
synced 2025-04-27 13:13:07 +00:00
21 lines
324 B
Go
21 lines
324 B
Go
package request
|
|
|
|
import (
|
|
"net/http"
|
|
"net/url"
|
|
)
|
|
|
|
const (
|
|
PathParamConnectorRef = "connector_ref"
|
|
)
|
|
|
|
func GetConnectorRefFromPath(r *http.Request) (string, error) {
|
|
rawRef, err := PathParamOrError(r, PathParamConnectorRef)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
// paths are unescaped
|
|
return url.PathUnescape(rawRef)
|
|
}
|