Feature: add basic api for proxy provider

This commit is contained in:
Dreamacro
2019-12-11 17:31:15 +08:00
parent 29cf3ca0ef
commit 95e9ae2d8d
6 changed files with 129 additions and 10 deletions

17
hub/route/common.go Normal file
View File

@ -0,0 +1,17 @@
package route
import (
"net/http"
"net/url"
"github.com/go-chi/chi"
)
// When name is composed of a partial escape string, Golang does not unescape it
func getEscapeParam(r *http.Request, paramName string) string {
param := chi.URLParam(r, paramName)
if newParam, err := url.PathUnescape(param); err == nil {
param = newParam
}
return param
}